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.
I have a table as defined below. The DAX column is the column I am trying to create.
I want to have the DAX column flag each row with a yes or no.
Conditions for a yes
Condition for no
How would I write the DAX for this flag? I've tried to think of a way to do it with a nested IF but I can't seem to figure it out. Thanks.
Name | Date | Location | DAX COLUMN |
Bob | Monday, October 1, 2018 | A | yes |
Bob | Monday, January 1, 2018 | A | yes |
Bob | Thursday, March 1, 2018 | A | yes |
Jane | Monday, January 1, 2018 | A | no |
Jane | Thursday, March 1, 2018 | B | yes |
Jane | Monday, October 1, 2018 | B | yes |
Mike | Monday, January 1, 2018 | B | no |
Jerry | Monday, October 1, 2018 | C | yes |
Solved! Go to Solution.
Hi @tasmiaa
Try this for your column. It assumes that no rows have a blank() at Location:
DAXColumn = VAR _OctoberLocation = LOOKUPVALUE ( Table1[Location], Table1[Date], DATE ( 2018, 10, 1 ), Table1[Name], Table1[Name] ) RETURN IF ( Table1[Location] = _OctoberLocation, "Yes", "No" )
Hi @tasmiaa
Try this for your column. It assumes that no rows have a blank() at Location:
DAXColumn = VAR _OctoberLocation = LOOKUPVALUE ( Table1[Location], Table1[Date], DATE ( 2018, 10, 1 ), Table1[Name], Table1[Name] ) RETURN IF ( Table1[Location] = _OctoberLocation, "Yes", "No" )
Thank you! That worked wonderfully! I didn't even know I could make a var.
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 |
---|---|
110 | |
94 | |
80 | |
67 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |