Forum Discussion
WBscooby
Helper III
5 years agoUsing filters in measures/ Applying to a visual
Hi I am getting in a mess with filters again and would appreciate some guidance. I have created a simple replica of my file as my data is quite sensitive. Essentially I have 2 key tables - Sa...
Anonymous
5 years agoNot applicable
Hi WBscooby ,
Here are the steps you can follow:
1. Create measure.
Measure 2 =
var _select=SELECTEDVALUE('SalesTransactions'[Outcome Level])
return
SWITCH(
TRUE(),
_select="High",
CALCULATE(DISTINCTCOUNT('SalesTransactions'[Link ID]),FILTER(ALL('SalesTransactions'),'SalesTransactions'[RepeatHigh]=MAX('SalesTransactions'[RepeatHigh])&&'SalesTransactions'[Cohort]=MAX(SalesTransactions[Cohort])&&'SalesTransactions'[Outcome Level]="High")),
_select="Low",
CALCULATE(DISTINCTCOUNT('SalesTransactions'[Link ID]),FILTER(ALL('SalesTransactions'),'SalesTransactions'[RepeatLow]=MAX('SalesTransactions'[RepeatLow])&&'SalesTransactions'[Cohort]=MAX(SalesTransactions[Cohort])&&'SalesTransactions'[Outcome Level]="Low")),
BLANK()
)
2. Result.
Outcome level = High:
Outcome level = Low:
When you select Low, your Link ID has only eight totals in the table, so it will appear that when you select "Low", the number in the pie is reduced, so you can see if there is an error in which step, which causes the total to decrease.
You can downloaded PBIX file from here.
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.