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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AI14
Helper III
Helper III

combine column data for visualisation

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
777789
787330
333350
351350L
339 
388 
380 

 

 

#
MIN
GIN
1 ACCEPTED SOLUTION
Anonymous
Not applicable

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")

 

vxinruzhumsft_0-1674540335862.png

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.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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")

 

vxinruzhumsft_0-1674540335862.png

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.

FreemanZ
Super User
Super User

hi @AI14 

can you explain the logic behind the Excel formula?

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 "#"

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.