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.
It appears to be only a single value, judging from the output. How would the MAXX wrap arround the groupby statment? I tried, but my attempt failed.
[Number Of Customers]
"1182"
VAR _aggtable =
maxx(,
FILTER(
GROUPBY(
_summarytable,
[Distributor Type],
"Number Of Customers", COUNTX( CURRENTGROUP(),1)
),
[Distributor Type]="New Tank Distributor"
),
[Number Of Customers]
)
should be something like this.
- mmahoney0452 years agoRegular Visitor
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.
- Daniel291952 years agoCommunity Champion
- 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