Forum Discussion
bourne2000
Helper V
4 years agoFilter visual by measure not working
Hi I have a big data which is 3.3 million and coming from AWS Redshift. I connected through direct query In my table I have a column called Merchant ID. I need to calculate distinct count the...
Anonymous
4 years agoNot applicable
Hi bourne2000 ,
I created some data:
You may build a slicer Table as below and build a measure to achieve your goal : show different result if you select different options.
1. Use Enter data to create a slice table.
2. Create measure.
Total Merchants =
DISTINCTCOUNT('instore_transactions_la_month'[Merchant ID])Flag =
IF(
[Total Merchants]>1,1,0)Total =
var _table=SUMMARIZE('instore_transactions_la_month',[Group],"1",[Total Merchants],"2",[Flag])
return
IF(SELECTEDVALUE('Table'[option])=TRUE(),SUMX(FILTER(_table,[2]=1),[Total Merchants]),SUMX(FILTER(_table,[2]=0),[Total Merchants])
)
3. Result:
When the slicer is True:
When the slicer is False:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly