Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
i want to group specific types together and if i wanted to add additional columns to visualisation table it would read behind the group and look at data.
i assume its like excel where you write a if and statement but can it be a measure or is it better to a custom column?
e.g
=if(and(types=333,types=339),A330,types
=if(and(types=351,#="min"),A350L,types
types | > | Types |
777 | 789 | |
787 | 330 | |
333 | 350 | |
351 | 350L | |
339 | ||
388 | ||
380 |
# |
MIN |
GIN |
Solved! Go to Solution.
Hi @AI14
Here is the example based on my understanding of the information you have offered.
You can create a new column, you can use switch() function
Types = SWITCH(TRUE(),OR(Query1[type]=777,Query1[type]=787),"787",OR(Query1[type]=333,Query1[type]=339),"A380",Query1[type]=351,"350")
and I cannot sure that if your "#" is a column in the table above, or a field to be put to a slicer.
You can refer to the following link to know about switch() function.
SWITCH function (DAX) - DAX | Microsoft Learn
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AI14
Here is the example based on my understanding of the information you have offered.
You can create a new column, you can use switch() function
Types = SWITCH(TRUE(),OR(Query1[type]=777,Query1[type]=787),"787",OR(Query1[type]=333,Query1[type]=339),"A380",Query1[type]=351,"350")
and I cannot sure that if your "#" is a column in the table above, or a field to be put to a slicer.
You can refer to the following link to know about switch() function.
SWITCH function (DAX) - DAX | Microsoft Learn
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
i want the left types to be grouped to the right so i can use a groupe type instead of them individually.
i tried to do a if(and formula in powerbi but it wouldnt allow me to have more than 2 if's
desired column outcome:
787 & 777 > 787
333 & 339 > A380
351 > 350
351 + reg > 350L (reg could be on of exampleson the table below the eg "#"
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |