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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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