Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
PowerBIFreak
Helper II
Helper II

There is no <> in DAX???

Hello Folks,

I have something like this, as you can see I have 2 columns. The code 703, 600, 603, 714, and 806 categorized has "Unplaned hours". The rest, we categorized it has "Vacation hours". So, I created a column measure - Categories.

I use SWITCH function:

Categories = Switch (true(), timetbl[code]<=600, "Unplaned hours")

No, that doesn't work! So, does it mean that i have to list every single code in my dax? Something like:

Categories = Switch (true(), timetbl[code]=600, "Unplaned hours", imetbl[code]=603, "Unplaned hours"...

 

Please help. Thank you!

 

TextCode
Sick703
Family Sick600
Injury603
Breament Leave714
Half Sick Paid806
Floating Holiday800
Vacation801
1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

You should be able to write one of these column expressions

 

Categories = Switch (true(), timetbl[code]<=600, "Unplanned hours", "Vacation Hours")

or

Categories = IF(timetbl[code]<=600, "Unplanned hours", "Vacation Hours")

 

You could also just use a Groups column too, to categorize codes into different buckets.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Employee
Employee

You should be able to write one of these column expressions

 

Categories = Switch (true(), timetbl[code]<=600, "Unplanned hours", "Vacation Hours")

or

Categories = IF(timetbl[code]<=600, "Unplanned hours", "Vacation Hours")

 

You could also just use a Groups column too, to categorize codes into different buckets.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.