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
FrancoGR
New Member

DAX - Multiply filtered row by multiple columns and show in visualization

Hi, please your help. I've been trying to combine in a matrix report:

1. Table A. each row represent a task and, de type of distribution (this is variable) and the cost of the task

2. Table B. The kind of distribution that affects echa task

I need in a matrix report and abstract of each Dist and its cost distribuited en echa center.

Adding an example for better explanation.

 

ejm.png

 

Sorry about my english. Thanks

 

Franco Guevara

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@FrancoGR , Unpivot the table B in power query and merge it with Table A, and then create a new column that is the multiplication of % from B and Costo from A

 

https://radacad.com/pivot-and-unpivot-with-power-bi
Append : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

 

Otherwise join the two in Model view assuming B on 1 side

 

Create new measures

 

Center W m = Sumx(TableA, TableA[Costo] * related(TableB[Center W]) )

 

same way others , examples

Center X m = Sumx(TableA, TableA[Costo] * related(TableB[Center X]) )

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@amitchandak yes that will work but then needs to create four measures, and if I have to solve for this I will stay away from that but not a bad solution. Cheers!!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@amitchandak unpivot will not work because it will create many to many relationships and in that case, RELATED will not work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k , I mentioned that solution under "Otherwise join"

 

Sorry, If that was not clear @parry2k , @FrancoGR .

 

There are two solutions. one assuming 1-M join, Assuming B on one side

amitchandak
Super User
Super User

@FrancoGR , Unpivot the table B in power query and merge it with Table A, and then create a new column that is the multiplication of % from B and Costo from A

 

https://radacad.com/pivot-and-unpivot-with-power-bi
Append : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

 

Otherwise join the two in Model view assuming B on 1 side

 

Create new measures

 

Center W m = Sumx(TableA, TableA[Costo] * related(TableB[Center W]) )

 

same way others , examples

Center X m = Sumx(TableA, TableA[Costo] * related(TableB[Center X]) )

@amitchandak 
thank You. Worked perfectly.

 

Franco GR

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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