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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jjck
New Member

How to Combine Data from Multiple Columns in DAX - For use in a Slicer

I am trying to create a slicer that can select which increase in percentage (or just the base value) is represented in all visuals/cards for a single page. They need to be categorized by Order ID in order for me to filter by other field (such as business sector, date of order, etc.). 

 

I know how to do this in Excel, but I want the page to be replicable by someone else once I transfer out of the department, so having a DAX code they could copy and paste when they refresh the dashboard is really what I'm after here. 

 

An example of the data I currently am working with is below:

Order IDBase Value2%3%5%
1100102103105
2300306309315
3150153154.5157.5
4200204206210

 

 

 

Any advice would be extremely helpful, and deeply appreciated. 

 

Thanks in advance, 

jjck

1 ACCEPTED SOLUTION
v-yohua-msft
Community Support
Community Support

Hi, @jjck 

Pick ID and Base value in PowerQuery, then select Unpivot Other Columns.

vyohuamsft_0-1719370731966.png

vyohuamsft_1-1719370750317.png

Select Apply. Then create a new column, use the following dax:

CombinedColumn = COMBINEVALUES ( "|", 'Table'[Order ID], 'Table'[Attribute] )

vyohuamsft_2-1719370830736.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

2 REPLIES 2
v-yohua-msft
Community Support
Community Support

Hi, @jjck 

Pick ID and Base value in PowerQuery, then select Unpivot Other Columns.

vyohuamsft_0-1719370731966.png

vyohuamsft_1-1719370750317.png

Select Apply. Then create a new column, use the following dax:

CombinedColumn = COMBINEVALUES ( "|", 'Table'[Order ID], 'Table'[Attribute] )

vyohuamsft_2-1719370830736.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

WishAskedSooner
Resolver I
Resolver I

I am not a Power BI expert, but my gut tells me you are going about this the wrong way using a bunch of calculated columns. In my opinion, a more robust solution would be to create a separate table with the various percentage increases. You can load this easily into a slicer and then create measures for your visuals using SELECTEDVALUE. This also offers the added benefit of adding more increases easily (e.g. 2.5%, 7%, etc.) versus having to expand out the number of calculated columns in your Orders table. My 2 cents.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.