Forum Discussion
Multiply measure by column and sum total
- 8 years ago
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] ) ) ) )
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] ) )
)
)- sr0018 years agoNew Member
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.
- Zubair_Muhammad8 years ago
Community Champion
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