The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance 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 |
---|---|
27 | |
12 | |
8 | |
8 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
11 | |
7 |