Forum Discussion
Filter Multiple Columns for multiple filter options to create a Measure
- 5 years ago
Hi, acerNZ
According to your case link, I can understand your requirement clearly now, you can try this measure:
Min count = var _col1=COUNTX(FILTER(ALL('Table'),[Col1] in {"Yes","Not sure"}),[Col1]) var _col2=COUNTX(FILTER(ALL('Table'),[Col2]<>"Not sure"&&[Col2] in {"Yes","Parked"}),[Col2]) var _col3=COUNTX(FILTER(ALL('Table'),[Col3]<>"No order"&&[Col3] in {"No","New York"}),[Col3]) return IF(_col1<=_col2,IF(_col1<=_col3,_col1),IF(_col2<=_col3,_col2,_col3))Then place the measure into a card chart to check if the value can be correct(My result is based on my test data):
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, acerNZ
According to your description, I can roughly understand your requirement, it seems that you want to make one measure to filter the table based on three columns, right? I think you can try this measure and apply it as the filter of the table chart:
This is my test data based on your DAX formula:
I created a measure like this:
Flag =
var _Col1=IF(MAX('Table'[Col1]) in {"Yes","Not sure"},1,0)
var _Col2=IF(MAX('Table'[Col2])<>"Not sure"&&MAX('Table'[Col2]) in {"Yes","Parked"},1,0)
var _Col3=IF(MAX('Table'[Col3])<>"No order"&&MAX('Table'[Col3]) in {"No","New York"},1,0)
return
IF(_Col1+_Col2+_Col3=3,1,0)
Then I created a table chart like this:
Then I apply a filter to the table chart to perform as the filter of the table:
And you can get what you want.
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-robertq-msft Thank you for the response.
As there were multiple copies of this, I created another thread(Community is throwing fatal error on submission, but actually post is already submitted)
I have individually calculated each filter as you said. The easiest way is to say smallest of three as that is common. The question is how and if there are other straight forward ways
Thanks a lot
- v-robertq-msft5 years agoCommunity Support
Hi, acerNZ
According to your case link, I can understand your requirement clearly now, you can try this measure:
Min count = var _col1=COUNTX(FILTER(ALL('Table'),[Col1] in {"Yes","Not sure"}),[Col1]) var _col2=COUNTX(FILTER(ALL('Table'),[Col2]<>"Not sure"&&[Col2] in {"Yes","Parked"}),[Col2]) var _col3=COUNTX(FILTER(ALL('Table'),[Col3]<>"No order"&&[Col3] in {"No","New York"}),[Col3]) return IF(_col1<=_col2,IF(_col1<=_col3,_col1),IF(_col2<=_col3,_col2,_col3))Then place the measure into a card chart to check if the value can be correct(My result is based on my test data):
You can download my test pbix file below
If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.
How to Get Your Question Answered Quickly
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.