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.
to return a scalar value from the second table , assuming that this returns only one row :
VAR _aggtable =
selectcolumns(,
FILTER(
GROUPBY(
_summarytable,
[Distributor Type],
"Number Of Customers", COUNTX( CURRENTGROUP(),1)
),
[Distributor Type]="New Tank Distributor"
),
[Number Of Customers]
)
if it returns multiple rows, then you need to either filter to one row, or to use one of the iterators base on your business logic :
sumx , maxx, minx, . ..
let me know if thelps.