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.
Hey!
Im having some issues with using the "Conditional Column" module, for creating groups from a column containing more than 500 different values.
Right now the code for this looks like " else if [Konto] = "20230" then "Eksterne omkostning" else if [Konto] = "20235" then "Eksterne omkostning" else if [Konto] = "20240"" etc.
But I cant figure out how to make it into a shorter and easier to manage code.
Hi @Anonymous
use switch() in DAX, in your case
Column = SWITCH([Konto],
"20230", "Eksterne omkostning",
"20235", "Eksterne omkostning" ,
"Other")
solutions for power query will not be very much beautiful 🙂
So if I want to have 10 different values in one group I could do it like this:
Column = Switch([Konto]),
"20230", "20030"; "Ekstern omkostning";
hi @Anonymous
Yes, you could IF() or Switch() Function to get it, see more details by this blog:
https://powerpivotpro.com/2012/06/dax-making-the-case-for-switch/
Regards,
Lin
I used another method instead. By creating a SQL statement, it seems a little easier to create the new groups.
But I still need to figure out how to pick values between two values.
So from 1...5 = one group
6....8 = another group
13..15 18..20 = a third group.
Hope it makes some sence.
Hello @JessVinsteen
Try this logic:
Column?
Best regards
Lin
Create a second table in Excel or something with the translations between the numbers and the text values. Use a Merge query.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |