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
SimonJacobs
Helper I
Helper I

How to calculate the difference between two numbers to create new measure

I'm trying to calculate a value which I believe should be a measure but am not sure how to do it.  I have a set of data points for a list of brands and I want to create a new value which calcuates the difference between two of the values.

 

The data is structured as follows

Brand 1  - Aware  - 60%

Brand 1 - Familiar - 20%

Brand 1 - Would recommend - 15%

Brand 2 - Aware - 45%

Brand 2 - Familiar - 13%

Brand 2 - Would recommend - 3%

 

Familiar is a subset of those Aware and I would like to create a a measure that is 'Aware but not Familiar' - e.g. For Brand 1 it would be 60%-40% = 20%.  Is that possible?

 

Thanks in advance for any advice!

1 ACCEPTED SOLUTION
KGrice
Memorable Member
Memorable Member

Hi @SimonJacobs. It sounds like this is already in a table with the structure you provided. I'll call the columns Brand, Impression, and Percent. With that, you could start with a simple measure:

 

Percent Sum = SUM(TableName[Percent])

 

That might not be useful on its own, but you can use it in two more measures that specify how you want to calculate it:

 

Percent Aware = CALCULATE([Percent Sum], TableName[Impression]="Aware")
Percent Familiar = CALCULATE([Percent Sum], TableName[Impression]="Familiar")

 

Combine those to get your end result:

 

Aware but not Familiar = [Percent Aware] - [Percent Familiar]

 

You could do all of that in one step, but those building blocks will help with your readability and you can reuse them for other measures as well.

View solution in original post

2 REPLIES 2
KGrice
Memorable Member
Memorable Member

Hi @SimonJacobs. It sounds like this is already in a table with the structure you provided. I'll call the columns Brand, Impression, and Percent. With that, you could start with a simple measure:

 

Percent Sum = SUM(TableName[Percent])

 

That might not be useful on its own, but you can use it in two more measures that specify how you want to calculate it:

 

Percent Aware = CALCULATE([Percent Sum], TableName[Impression]="Aware")
Percent Familiar = CALCULATE([Percent Sum], TableName[Impression]="Familiar")

 

Combine those to get your end result:

 

Aware but not Familiar = [Percent Aware] - [Percent Familiar]

 

You could do all of that in one step, but those building blocks will help with your readability and you can reuse them for other measures as well.

This is great, thank you!

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.