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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Super User
Super User

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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