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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

NEED HELP COUNT CARD WITH DAX IS BLANK WHEN MULTIPLE IDS ARE SELECTED ON FILTER

Hey everyone,

 

I created this DAX Measure which accomplished what I need when I only have one item selected in the filter however when I select all or multiple IDS, the count card cant display anything and throws out an error. 

 

SAIDI_CIRCUIT =

CALCULATE

(DIVIDE (SUM(OUTAGE_SUMMARY[CUSTOMER_MINUTES]),[CKTAVGMETERCNT],0),

FILTER(OUTAGE_SUMMARY,OUTAGE_SUMMARY[NOTIFICATION_DESCRIPTION] = ALLSELECTED(OUTAGE_SUMMARY[NOTIFICATION_DESCRIPTION])))

 

Basically my calculation divides Customer Minutes by Avg Meter Count where I apply a filter to grab all values selected in notification description within my slicer. 

 

My count card is only working and displaying when I select 1 circuit, if i select multiple circuits/ids it throws an error. 

How can i build a DAX so I can see 1465.16 which is the sum of both outputs. 

 

CircuitCustomer MinsAvg Meter CntExpected Output
A726,540908800.15
B604,496909665.01

 

 

Screenshot (24)_LI.jpg

 

For example, right now this measure will be able to give individual numbers so if i select A, it will comfortably give me 800.15 howeber when i multiselect A and B, the visual doesnt show. My count card should show 800.15+665.01 = 1465.16 if i was to select both. 

 

Screenshot (25)_LI.jpg

 

What am i missing in the dAX that it wont show the sum of multiple selections?

1 ACCEPTED SOLUTION

Hi,

Assuming Customer Mins and Avg Meter Cnt are measures, try these measures

Measure1 = IFERROR([Customer Mins]/[Avg Meter Cnt],BLANK())

Measure2 = SUMX(VALUES(Data[Circuit]),[Measure1])

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
parry2k
Super User
Super User

@Anonymous you need to provide more detail, how your tables are connected, sample data and expected output especially the tables used in this measure.

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi Parry,

 

Basically my calculation Divides Customer Minutes by Avg Meter Count. The result is below. 

My count card is only displaying when I select 1 circuit, if i select multiple it throws an error. 

How can i build a DAX so I can see 

1465.16 

 which is the sum of both outputs. 

 

CircuitCustomer MinsAvg Meter CntExpected Output
A726,540908800.15
B604,496909665.01

Hi,

Assuming Customer Mins and Avg Meter Cnt are measures, try these measures

Measure1 = IFERROR([Customer Mins]/[Avg Meter Cnt],BLANK())

Measure2 = SUMX(VALUES(Data[Circuit]),[Measure1])

Hope this helps.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

This worked like a charm! Thank you so much. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hey Ashish,

 

One thing I noticed is the performance of the report took a hit when I implemented the SUMX dax measure, is there another alternative to the dax? or way to optimize it? could calculate(sum() work the same?

Hi,

I am not sure of that.  May be someone else can pitch in.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@nataliengarce try this measure

 

Avg = SUMX ( 'Table', DIVIDE ( 'Table'[Customer Mins], 'Table'[Avg Meter Cnt] ) )

 Would appreciate Kudos 🙂 if my solution helped.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.