Forum Discussion
Filtering date needs to affect created DAX column value
Hi guys,
in this example I've created a column "Qualified" that should return "Yes" when a Brand has at least once Type = "Blue" in a monthdate.
Brand A has Qualified = Yes because in March it has Type = Blue, regardless of A having Red in other months. So this works fine so far.
Now I want to filter the date for the last 2 months, now it's end of May. In this case A has only Type = Red in April and May, so Qualified should show "No". However the date filter does not affect the Qualified column here.
How can I adjust the Qualified column so that it shows "No" for Brand A after filtering the date?
Thank you.
Hi thhmez7 ,
Pls test the below measure:
test = if(CALCULATE(COUNT(Brand[Brand]),ALLSELECTED(Brand),Brand[Brand]=MAX(Brand[Brand])&&Brand[Type]="Blue")>=1,"Yes","No")Outputresult:
Filter:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
4 Replies
- HotChilliCommunity Champion
You'll need a measure for this. A column doesn't change to reflect a filter or slicer.
- thhmez7Helper III
How can I create a measure like that? How can the error be adjusted?
- v-luwang-msftCommunity Support
Hi thhmez7 ,
Pls test the below measure:
test = if(CALCULATE(COUNT(Brand[Brand]),ALLSELECTED(Brand),Brand[Brand]=MAX(Brand[Brand])&&Brand[Type]="Blue")>=1,"Yes","No")Outputresult:
Filter:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
- thhmez7Helper III
Thank you, it works.
One more question: How can I distinct count the Brand that has "No" in the Qualified measure?
Here the sum should be 2:
Without the date filter, the sum should be 1:
Thank you.