Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
128 | |
109 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |