Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Variable dependent line chart

Hi everybody,

 

I have created a line chart and controlling the input through a slicer as shown in the pic attached img1.When i select "a" from slicer, chart gets sliced to it and calculation associated and when i select "a" and "b", chart gets sliced with this and shows two lines a(unit) and b( amt).

Now if i do not select anything, it shows all three lines. However i want this to be completey blank. There should not be any line if i don't select ahything from slicer.

 

Formula which i used while creating 3 measures is mentioned below:

Billed Amt =
var logictest=
COUNTROWS(DISTINCT(
FILTER(
ALLSELECTED('Sheet1 (2)'[calc name]),
'Sheet1 (2)'[calc name]="b"
)
)) = 1
return
if(logictest,
sum(billinfo[CURRENTTOTALBILL]),
BLANK()
)

Billed Unit =
var logictest=
COUNTROWS(DISTINCT(
FILTER(
ALLSELECTED('Sheet1 (2)'[calc name]),
'Sheet1 (2)'[calc name]="a"
)
)) = 1
return
if(logictest,
count(billinfo[unitconsumed]),
BLANK()
)

 

Customers =
var logictest=
COUNTROWS(DISTINCT(
FILTER(
ALLSELECTED('Sheet1 (2)'[calc name]),
'Sheet1 (2)'[calc name]="c"
)
)) = 1
return
if(logictest,
DISTINCTCOUNT(billinfo[CONSUMERNO]),
BLANK()
)

 

Regards,

No Replies