cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sr001 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User
Super User

Re: Multiply measure by column and sum total

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] ) )
    )
)

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Multiply measure by column and sum total

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] ) )
    )
)

View solution in original post

sr001 Frequent Visitor
Frequent Visitor

Re: Multiply measure by column and sum total

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.

Super User
Super User

Re: Multiply measure by column and sum total

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

 

 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 6 members 1,523 guests
Please welcome our newest community members: