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

How to get correct total in matrix using measure with an if statement

Hello everyone,

 

I have a problem calculating the total in a matrix visualization when using a measure with an if statement.

 

I created this simplified model to ask this doubt (that’s why some numbers don’t make sense, it’s just to express it with more clarity.

 

The goal is to create a measure that offers a 50% discount if the customers bought more than 40% regarding their target and no discount otherwise. Except just for customer C who will receive a 20% discount if he bought more than 10%.

 

I send the screens of what I have tried so far. I created the measure that shows the correct discount for every customer but it doesn’t show the correct amount for the total.


Base:

BaseBase

 

 

Matrix and discount measure created:

 

MatrixMatrix

Thanks in advance!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 

You can create new measure

SUMX ( VALUES (base[customer]), [discount] )

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

It worked perfectly, thanks a lot!!

tamerj1
Super User
Super User

Hi @Anonymous 

You can create new measure

SUMX ( VALUES (base[customer]), [discount] )

 

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.

Top Solution Authors