Forum Discussion
Create Measure From Virtual Table
- 2 years ago
well, you can t use summarizecolumns in measure
try using addccolumns ( summarize ( .. ) instead .
and for the return, just return aggregation without the { } .
the { } were only needed for the query not to be used in the measure.
hope this makes sense.
Ah, sorry. the error states: The 3 argument to the MAXX function contains a flag that is not supported.
Its bizarre that converting a table value to scalar is this difficult.
- mmahoney0452 years agoRegular Visitor
Here is the code:
VAR _aggtable =MAXX(,FILTER(GROUPBY(_summarytable,[Distributor Type],"Number Of Customers", COUNTX( CURRENTGROUP(),1)), [Distributor Type]="New Tank Distributor"),[Number Of Customers])EVALUATE_aggtable - Daniel291952 years agoCommunity Champion
- mmahoney0452 years agoRegular Visitor
I tried that and unfortunately the error changes to "The expression specified in the query is not a valid table expression".
- Daniel291952 years agoCommunity Champion
because it is returning a scalar value, you cant use it like this when authoring a dax query
to be able to see it in the query editor,, write the evaluate like this :
evaluate { _aggtable } - mmahoney0452 years agoRegular Visitor
It worked in DAX editor , but not when I went to set up the measure in the visualization page. Any other changes necessary to make this scalar work in a measure?
DAX editor result:
Measure Code:
- Daniel291952 years agoCommunity Champion
well, you can t use summarizecolumns in measure
try using addccolumns ( summarize ( .. ) instead .
and for the return, just return aggregation without the { } .
the { } were only needed for the query not to be used in the measure.
hope this makes sense.
- mmahoney0452 years agoRegular Visitor
This worked Daniel. Thank you!