Showing results for 
Search instead for 
Did you mean: 
Not applicable

DAX Measure based on if statement from different aggregations

Hello everyone,


I have a problem calculating the total in a matrix visualization using a measure with an if statement. I created this simplified model to ask this doubt.


The goal is to create a measure that:

- offers a 50% discount on books if customers bought more than 40% regarding the previous year and no discount otherwise

- offers a 20% discount on the other products (pens and pencils) if customers bought more than 30% regarding the previous year and no discount otherwise

- even if the above is fulfilled for some products, there will be no discount if in the sum of all the products the buyer didn't buy more than 10% compared to the previous year


I send the screen of the matrix summarizing what I should achieve:



Thanks in advance!


Sample data:


Super User
Super User

@Anonymous hi! can you paste the sample data?




Not applicable

Yes, I have just edited the post and uploaded it, thanks!

Helpful resources

November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors