The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
14 | |
10 | |
10 | |
9 |