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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
patri0t82
Post Patron
Post Patron

Divide using DistinctCount NOT at Row Level

Hello,

I have a simple enough DAX measure:

 

1YR Trailing MTBF =
DIVIDE('MTBF - Combined'[Asset Count] ,
(CALCULATE( SUM('MTBF - Combined'[Failure]), DATESMTD(DATEADD(CalendarTable[Calendar],0 , MONTH )))
)
) * 12 + 0
 
The portion I'm having a problem with is blue. At each row level in the visualization, 'MTBF - Combined'[Asset Count] is only representing the total for the month. I need my formula to use the total for the entire table. IE 2,392 instead of only 22 (for the one month).
 
I tried using DISTINCTCOUNT, but it's the same result. Is there a simple way to capture the total number of assets in my measure?
1 ACCEPTED SOLUTION
patri0t82
Post Patron
Post Patron

I was able to resolve the issue using the ALL function inside CALCULATE:

1YR Trailing MTBF =
DIVIDE(CALCULATE(DISTINCTCOUNT('MTBF - Combined'[Equipment ID]),ALL('MTBF - Combined')),
(CALCULATE( SUM('MTBF - Combined'[Failure]), DATESMTD(DATEADD(CalendarTable[Calendar],0 , MONTH )))
)
) * 12 + 0

View solution in original post

1 REPLY 1
patri0t82
Post Patron
Post Patron

I was able to resolve the issue using the ALL function inside CALCULATE:

1YR Trailing MTBF =
DIVIDE(CALCULATE(DISTINCTCOUNT('MTBF - Combined'[Equipment ID]),ALL('MTBF - Combined')),
(CALCULATE( SUM('MTBF - Combined'[Failure]), DATESMTD(DATEADD(CalendarTable[Calendar],0 , MONTH )))
)
) * 12 + 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.