Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
My problem is thus: I have a column with addresses (we'll call it "Location") and a column with values A or B (we'll call it "Letter"). I need to return rows where, for the same value in Location, there are both rows with A, and some with B.
Here's an example. I'm using a column called "Flag" in this case as my intention for filtering, where I would include "True" in a visual and leave "False" out. Perhaps a measure would be better, but I don't know, yet.
Location | Letter | Flag |
California | A | True |
New York | B | False |
Wyoming | A | False |
California | B | True |
New York | B | False |
So, because there are rows for Location = California where Letter = A and rows for Location = California where Letter = B, I want to include those California rows. For the others, (Wyoming is always A, New York is always B) I would not return those rows/locations. Note that I don't know which Locations will return "True", so I don't want to write logic that is specific to strings "California", "Wyoming", "New York"... it should work for any Location where the associated Letter is sometimes A and sometimes B.
What is the most efficient way for me to do this? Even if it's not necessary to create a new column, all I really want to do is filter a chart for those 'Locations' where multiple 'Letters' are associated.
Thanks!
Solved! Go to Solution.
@Anonymous try this measure
Measure =
VAR __tbl = CALCULATETABLE ( VALUES ( Location[Letter] ), ALLEXCEPT ( Location, Location[Location] ) )
RETURN
IF ( COUNTROWS ( __tbl ) >= 2, 1, 0 )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous try this measure
Measure =
VAR __tbl = CALCULATETABLE ( VALUES ( Location[Letter] ), ALLEXCEPT ( Location, Location[Location] ) )
RETURN
IF ( COUNTROWS ( __tbl ) >= 2, 1, 0 )
Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
This works great, thank you!!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
118 | |
105 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |