The recipe presented works for the common shape of a semicircle. However, any line can use the same technique, including lines that form triangles, lines with exponential equations, and even sine waves. To prove this is the case, do the following:
- Create the following columns in the R02_Table table:
Y1 = RANDBETWEEN(15,50)
A1 =
VAR __Table = ALL('R02_Table')
VAR __Max = MAXX(__Table,[X])
VAR __Min = MINX(__Table,[X])
VAR __Increment =
DIVIDE(
__Max - __Min + 1,
COUNTROWS(__Table)
)
RETURN
[Y1]*__Increment
- Create the following measure:
AreaApproximation1 =
VAR __Table = ALL('R02_Table')
VAR __Max = MAXX(__Table,[X])
VAR __Min = MINX(__Table,[X])
VAR __Increment =
DIVIDE(
__Max - __Min + 1,
COUNTROWS(__Table)
)
RETURN
SUMX(
ADDCOLUMNS(
__Table,
"__Area",[Y1]*__Increment
),
ABS([__Area])
)
- On a Report page, create a Line and clustered column chart visualization and place the X column from the R02_Table table into the Shared axis area.
- In the same Line and clustered column chart visualization, place the A1 column from the R02_Table table into the Column values area, and the Y1 column from the R02_Table table into the Line values area.
- On the same Report page, create a Card visualization and place the AreaApproximation1 measure into the Fields area for the visual.
The formulas for the A1 column and the AreaApprimation1 measure are identical to the formulas for the A column and the AreaApproximation measure except that both refer to the Y1 column instead of the Y column.