Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have table that looks like this:
id | Actityvity | Device |
1 | Relax | Mobile |
2 | Hyper | PC |
3 | Laid Back | Mobe |
4 | Relax | Mobile |
5 | Hyper | PC |
6 | Laid Back | Mobile |
I'm trying to create a new caloumn by applying the If statement in Dax, to say: IF Activity = Relax And Device= Mobile Then 1.
What the best way to go about it.
Thanks
Solved! Go to Solution.
Hi @Anonymous ,
Create a New Column
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Anonymous ,
Create a New Column
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Are you trying to make a calculated column or a measure? If a column, you can use this expression (substitute the name of your table for 'Table')
NewColumn = if(AND(Table[Activity]="Relax", Table[Device]="Mobile"), 1, 0)
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi mohoneypat,
unfortunately, using this dax isn't recognizing my table.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
12 | |
10 | |
6 |