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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
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:

ladislaocsulak_0-1660180103894.png

 

Thanks in advance!

 

Sample data:

https://drive.google.com/drive/folders/14_aZz5wd2W6SdXZoWwTfPX_JXQUBh2k4?usp=sharing

 

2 REPLIES 2
BeaBF
Super User
Super User

@Anonymous hi! can you paste the sample data?

 

Thx,

BBF

Anonymous
Not applicable

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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