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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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