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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sr001
New Member

Multiply measure by column and sum total

Hello All,

 

I have read the other discussions on this topic and am still having issues with my report. 

 

Fields.PNGTable and formula.PNG

 

I am trying to create a measure (or column) which will multiply Hours by Average ESR (15 * 96.14) for each row and then sum the total cost. Have tried to follow other suggestions but am ready to give up. Any help appreciated.

 

Thank you

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @sr001

 

I am not sure... but please give a SHOT to this MEASURE

 

MEASURE=
IF (
    HASONEVALUE ( '001'[Grade] ),
    SUM ( '001'[Hours] ) * AVERAGE ( 'ESR Rates'[ColumnName] ),
    SUMX (
        ALLSELECTED ( '001'[Grade] ),
        CALCULATE ( SUM ( '001'[Hours] ) )
            * CALCULATE ( AVERAGE ( 'ESR Rates'[ColumnName] ) )
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

HI @sr001

 

I am not sure... but please give a SHOT to this MEASURE

 

MEASURE=
IF (
    HASONEVALUE ( '001'[Grade] ),
    SUM ( '001'[Hours] ) * AVERAGE ( 'ESR Rates'[ColumnName] ),
    SUMX (
        ALLSELECTED ( '001'[Grade] ),
        CALCULATE ( SUM ( '001'[Hours] ) )
            * CALCULATE ( AVERAGE ( 'ESR Rates'[ColumnName] ) )
    )
)

Regards
Zubair

Please try my custom visuals

Thank you @Zubair_Muhammad !! 

 

That has worked perfectly, your help is much appreciated. 

 

I see (and think I understand the need for) that you have used SUM and SUMX, but what is the requirement for the HASONEVALUE line please.

 

Again, many thanks for your help.

Hi @sr001

 

Sorry for late reply... i was out of work

 

Actually ....it happens frequently with MEASURES that the sum of individual rows do not match the TOTAL ROW.

 

Check this precious post of @Greg_Deckler..

 

http://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/m-p/63376#U63376

 

HASONEVALUE lets you specify different formula for individual rows and the Total row

 

 


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.