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.
Thanks for the response!
Your solution does help to return a single row and column, which is the closest I've come so far. However it does not appear it is a pure scalar value because I cannot throw it in a card to display the single value on my dashboard.
Is it possible to run one of the aggregator functions over to entire result of the second virtual table?
Thank you,
Matt
- Daniel291952 years agoCommunity Champion
you can use maxx or minx if you are sure that you have 1 value . or you have multiple values all the same. mmahoney045
- mmahoney0452 years agoRegular Visitor
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"- Daniel291952 years agoCommunity Champion
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.