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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Dunner2020
Post Prodigy
Post Prodigy

Debugging measure

Hi there,

 

I created a measure that calculates some values. The measure looks like as follow:

 

Normalized SAIDI 24 hrs Unplanned =
var Time30Min = MAX('Outages and Interruptions'[Epoch Half Hour Number])
Return
CALCULATE ( SUMX(
FILTER(
filter(ALL('Outages and Interruptions'),'Outages and Interruptions'[Epoch Half Hour Number] <= Time30Min && 'Outages and Interruptions'[Epoch Half Hour Number] >= Time30Min-47),
[Zero Min Interruption]&&[Zero Customer Interruption]&&[External and LV interruptions]&&[description not contains]&&[Unplanned Interruption]),  [Normalised SAIDI 30 Mins Unplanned]))

 

I noticed that some measure is not producing the desired result. So I decided to debug and wrote another measure which looks like as follow:

 

 Debug =
var Time30Min = MAX('Outages and Interruptions'[Epoch Half Hour Number])
Return
CALCULATE ( COUNTROWS(
FILTER(  filter(ALL('Outages and Interruptions'),'Outages and Interruptions'[Epoch Half Hour Number] <= Time30Min && 'Outages and Interruptions'[Epoch Half Hour Number] >= Time30Min-47),
[Zero Min Interruption]&&[Zero Customer Interruption]&&[External and LV interruptions]&&[description not contains]&&[Unplanned Interruption])))
 
I found that actual measure performs calculation on 3 rows instead of 2 rows. Now I want to see what are those 3 rows. Could anyone guide me on how can I modify my debug measure so that it shows the actual rows instead of the count of row? Moreover, what is a good way of debugging the measure?
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Dunner2020 - Here is a good trick:

Normalized SAIDI 24 hrs Unplanned =
var Time30Min = MAX('Outages and Interruptions'[Epoch Half Hour Number])
Return
CALCULATE ( CONCATENATEX(
FILTER(
filter(ALL('Outages and Interruptions'),'Outages and Interruptions'[Epoch Half Hour Number] <= Time30Min && 'Outages and Interruptions'[Epoch Half Hour Number] >= Time30Min-47),
[Zero Min Interruption]&&[Zero Customer Interruption]&&[External and LV interruptions]&&[description not contains]&&[Unplanned Interruption]),  [Normalised SAIDI 30 Mins Unplanned]),",")

Replace your aggregator like SUMX with CONCATENATEX and then you can see what is going on "inside" your table essentially. Also, consider breaking your CALCULATE up into additional variables and then you can return individual variables as part of the measure to essentially look at what is going on inside at every step of the measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Dunner2020 - Here is a good trick:

Normalized SAIDI 24 hrs Unplanned =
var Time30Min = MAX('Outages and Interruptions'[Epoch Half Hour Number])
Return
CALCULATE ( CONCATENATEX(
FILTER(
filter(ALL('Outages and Interruptions'),'Outages and Interruptions'[Epoch Half Hour Number] <= Time30Min && 'Outages and Interruptions'[Epoch Half Hour Number] >= Time30Min-47),
[Zero Min Interruption]&&[Zero Customer Interruption]&&[External and LV interruptions]&&[description not contains]&&[Unplanned Interruption]),  [Normalised SAIDI 30 Mins Unplanned]),",")

Replace your aggregator like SUMX with CONCATENATEX and then you can see what is going on "inside" your table essentially. Also, consider breaking your CALCULATE up into additional variables and then you can return individual variables as part of the measure to essentially look at what is going on inside at every step of the measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors