Forum Discussion
Calculated Column IF Statement using "IN" for multiple values
- 7 years ago
Hi jcs93 ,
To create a measure as below.
Criteria1 = var th = VALUES(TextHereTable[TextHere]) var mt = VALUES(MoreTextTable[MoreText]) RETURN SWITCH(TRUE(), MAX(PowerBITest[TextHere]) in th && MAX(PowerBITest[MoreText]) in mt , "Meets Criteria", "Does Not Meet Criteria")Regards,
Frank
Anonymous
You both seem to be determined to convince me that what I'm doing doesn't work, so I've created an example of what I'm doing. Please download the PBIX at Criteria PBIX
Click on values in the slicers and watch the Criteria columns change with your own eyes. Upload it to your Power BI App workspace and watch it change there.
I too was convinced by the research and reading that I had done weeks ago that this was impossible. Then I tried it out of curiosity. Much to my surprise, the impossible was possible.
When you open my PBIX, you'll see the issue that I'm trying to get past. When no slicer selections are made, all the rows in the table should "Meet Criteria," however, they don't. This is what I'm asking for help to resolve, but you both seem stuck on the fact that the impossible is still impossible.
I've only been working with Power BI for a few months and one thing I've noticed is that it is an ever-evolving product where things that were once impossible, become possible because of user requests. I commend Microsoft for that.
Hi jcs93 ,
To create a measure as below.
Criteria1 =
var th = VALUES(TextHereTable[TextHere])
var mt = VALUES(MoreTextTable[MoreText])
RETURN
SWITCH(TRUE(),
MAX(PowerBITest[TextHere]) in th
&& MAX(PowerBITest[MoreText]) in mt
, "Meets Criteria", "Does Not Meet Criteria")
Regards,
Frank
- jcs937 years ago
Helper I
Thank you. Using your code as a measure corrects my issue, but leaves one behind.
I didn't show in my demo file, but I need the ability to display the Criteria in a stacked bar chart. Sadly, I cannot insert a measure into the legend field in a stacked bar chart (or any other field).
Please advise.
Thank you,
Jim