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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Sum rows of a 2 columns that have a value in 1

Actual UnitsCeiling Vol
2500
3600
0100
0200
5600

 

Actual Unit Utilization = SUM(Table1[Actual Units]) / SUM(Table1[Ceiling Vol]) * 100
 
I have tha above formula that takes sum of actual units and ceiling vol, and then times by 100 to get a percentage to basically find the utilization. However I want to find a way so that I only sum ceiling vol rows that also have a actual unit on the same row that isnt 0.
 
E.g. in above table, rows 3 and 4 the ceiling volume should not be summed.
So it should be ((2+3+5) / (500+600+600)) * 100
 
1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Simple enough

Actual Unit Utilization =
CALCULATE(
    SUM( Table1[Actual Units] ) / SUM( Table1[Ceiling Vol] ) * 100,
    Table1[Actual Units] <> 0
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

A_units = sum(Table[Actual units])

C_Vol = calculate(sum(Table[Ceiling vol]),Table[Actual units]<>0)

Measure = divide([A_units],[C_Vol])

Format Measure as a %.


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

Simple enough

Actual Unit Utilization =
CALCULATE(
    SUM( Table1[Actual Units] ) / SUM( Table1[Ceiling Vol] ) * 100,
    Table1[Actual Units] <> 0
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

AlB
Community Champion
Community Champion

Hi @Anonymous 

Try this

Measure_ =
VAR auxT_ = FILTER ( Table1, Table1[Actual Units] > 0 )
RETURN
    100 * DIVIDE ( SUMX ( auxT_, [Actual Units] ), SUMX ( auxT_, Table1[Ceiling Vol] ) )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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