Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
atishsingh
Regular Visitor

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,

img1.pngimg2.pngimg3.png

0 REPLIES 0

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors