Forum Discussion
Calculated Measure
thanks for the reply itayrom.
all the columns um using in the calculation are measures and when i try to create a calulated column instead of a measure um getting the following error.
"Function 'SUM' is not allowed as part of calculated column DAX expressions on DirectQuery models"
Should i create calculated columns instead of measures for all those Measure1 to Measure4 to perform the sum operation for Measure5 which should also be a calculated column instead of a measure...?
Anonymous
I guess that you’ve used SUM function in Measure1 to Measure4. According to this article, SUM is only supported in measure when using DirectQuery mode.
If you use Import mode here, you should be able to get the expected result by only changing Measure5 to Column5.
Best Regards,
Herbert
- Anonymous10 years agoNot applicable
yes exactly I've used Calculate and SUM functions in all measures.
Yeah um trying to go for import mode.
thanks for the reply.
I ll get back to you if i have any...!!
- Anonymous10 years agoNot applicable
Hi v-haibl-msft
I tried ur way.
and migrated to Import mode and created a 'New Column' for Measure5.
um not getting any error message but when try to use it um simply getting 0.00 value in the 'New Column'.
what did i miss.??
is there any expression to write..?
Measure5 = IF(Measure1 > Measure2 && Measure3 > Measure4, Measure1,0)
I tried both the following ways
1. New Column = (IF(Measure1 > Measure2 && Measure3 > Measure4, Measure1,0)
2. New Column = IF( Query1[Measure1] > Query1[Measure2] && Query[Measure3] > Query1[Measure4], Query1[Measure1],0 )
Consider the following image:
- jahida10 years agoImpactful Individual
I'm jumping in late but I think there's a lot of unnecessary work being done here that could be solved with a small modification to the initial measure:
Measure5 = SUMX('Table', IF(Measure1 > Measure2 && Measure3 > Measure4, Measure1,0))
Should work in whatever mode you want.
That should give you the aggregation you're looking for (sum at the row level).
- Anonymous10 years agoNot applicable