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
Anonymous
Not applicable

How to have measure differentiate calculations based off chart row?

I have a measure that is supposed to calculate the mean time between row events between each row.  I would like it done so that when drilling down a table/chart the "mean time between row events" is calculated based off the filtered subarray of that "more specific" row.

 

Currently it's correctly calculating this measure correctly for the main system, but incorrectly calculating the measure for the drilled down system (location in this example).

In this instance Pump A has 2 datapoints but it's only taking the time between every row in that system.

 

sbutton_1-1661203508639.png

 

Time Between WO = 

VAR rowdate = CALCULATE(MAX([Date Reported]), FILTER(ALL(Sheet), Sheet[Date Reported] < MAX([Date Reported]) && Sheet[System] = MAX([System])))
VAR rowdatesystem = CALCULATE(MAX([Date Reported]), FILTER(ALLEXCEPT(Sheet,Sheet[Location]), Sheet[Date Reported] < MAX([Date Reported]) && Sheet[System] = MAX([System])))
return 
    DATEDIFF ( rowdate, MAX ( [Date Reported] ), DAY )

MTBF = 
AVERAGEX (Sheet, [Time Between WO])

This is my code.

1 REPLY 1
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you please provide some data from your tables that used in your formula and let me know how your build relationships for them? Thanks in advance!

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.