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

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.

Reply
Anonymous
Not applicable

Sum selected by slicer values from 2 not interacted selections

Hello PowerBI Gurus,

 

I want to make a price calculator for materials. I have table with:

Table_1:

Product_ID, Product_Code, Unit_Price
-----

I have one new table with generated series to use as coefficient: 

Variables_Table = GENERATESERIES(0;150;1)
-----

I have also one Measure to multiply the Unit_Price by the measure:

Calculated_Price = MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value])

----

I want to have 2 slicers for Product_Code and 2 slicers for the Variable, so I can choose 2 products from the product list and to calculate each price, multiplied by the selected Variable value. This 2 groups are not Interacted(I have swithed off the Interactions between them with Format>Edit Interactions), so I can choose values from the same table on one page independently.

To this moment everything works fine, but i want to sum both calculated prices. How I can do this in PowerBI?

3.png

Thanks in advance!

BR

 

1 ACCEPTED SOLUTION

@Tad17 

The product of sum needs a row context. Try like

Calculated_Price = calculate(MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value]),Table_1[product])

Calculated_Price = sumX(summarize(Table_1,,Table_1[product],"_max",MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value])),[_max])

View solution in original post

3 REPLIES 3
Tad17
Solution Sage
Solution Sage

Hey @Anonymous 

 

What you need if a formula that uses your slicer value. See this thread: https://community.powerbi.com/t5/Desktop/Passing-Slicer-Value-into-Calculated-Formula-to-display-the/td-p/373218

 

All you have to do is create a measure that uses the guidelines in the thread above to find your slicer value for each slicer and then plug your calculated price into the formula using the slicer value as your FILTER instead of MAX for each slicer and then add the two together.

@Tad17 

The product of sum needs a row context. Try like

Calculated_Price = calculate(MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value]),Table_1[product])

Calculated_Price = sumX(summarize(Table_1,,Table_1[product],"_max",MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value])),[_max])
Anonymous
Not applicable

Can you explain me what are these - measures or calculated column? I tried them bu no success. Maybe I'm doing something wrong 😞

Calculated_Price = calculate(MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value]),Table_1[product]) 

Calculated_Price = sumX(summarize(Table_1,,Table_1[product],"_max",MAX(Table_1[Unit_Price])*MAX('Variables_Table '[Value])),[_max])

 

 

 


 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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