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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
YannDV
Frequent Visitor

Calculate function filter doesnt seem to work

Hi everyone, 

 

I have a little filter problem. I think i dont really understand how the calculate function works. YannDV_0-1643037895116.png

 
The objectif is to change the selected value of the sales in a slicer, to see how it impacts the net sales for example, but it hasnt anything to do with our problem, just to let you have the context. 
My problem is that I want to compare my sales and simulated sales, but my simulated sales formula doesnt work as I want. 
The sales is function is simply the sum of (Final Product Master Data'[€]) (the columns with my sales)
and the simulated sales is a measure : 
Simulated Sales = CALCULATE(SUM('Final Product Master Data'[€])*'Parameter Simulation Sales'[Parameter Simulation Sales Value],ALL('Final Product Master Data'[Article]))

 

The filter on the top left is used to filter the article (4015001050 for example) or the mold, which has been used to create the article. 

When I select an entire Mold, or a mold with only article, I have the correct number (450,54k in our example) as the simulation paramter is 1, and therefore sales = simulated sales. 

 

The problem is that when I select a mold with more than one article, the simulated sales measure still measure for the entire mold and not only the article selected. I thought it would work has I used the articles as filter in my calculate function. I guess I'm misunderstand something. 

Here is an example of the problem :

YannDV_1-1643038577858.png

So as you can see, simulated sales stays 450k while it should be 1,49k.

 

Does anyone has a solution ? 


Thanks a lot, 

 

Yannick 

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @YannDV ,

 

Your problem is this part of the Simulated Sales measure:

ALL('Final Product Master Data'[Article])

 

This is telling DAX to remove all filters on the data when calculating, including the filters applied by your slicers.

Try this instead:

Simulated Sales = [Sales] * 'Parameter Simulation Sales'[Parameter Simulation Sales Value]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
YannDV
Frequent Visitor

Thanks a lot!

BA_Pete
Super User
Super User

Hi @YannDV ,

 

Your problem is this part of the Simulated Sales measure:

ALL('Final Product Master Data'[Article])

 

This is telling DAX to remove all filters on the data when calculating, including the filters applied by your slicers.

Try this instead:

Simulated Sales = [Sales] * 'Parameter Simulation Sales'[Parameter Simulation Sales Value]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.