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

Troubles with KPI showing a measure

Greetings Community. I'm having troubles with a KPI showing a measure

 

Ihave a table like this (with a bunchof rows):

 

pregunta2.PNG

 

I have a Slicer with all the clients and another Slicer to filter the months like this:

 

pregunta3.PNG

 

I'm using this measure to calculate the net margin (Net revenue / Sales)

 

net_margin = SUMX( 'Tablename'; DIVIDE([Net revenue]; [Ventas Sales];0 ))

 

It works when I'm selecting only one client,

 

pregunta4.PNG

 

But when I select all clients, the measure calculates the SUM of all the net margins as shown in the second image. I would really appreciate some help on this matter please.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Thanks everyone. I figured it out watching some tutorials and learning how measures work, I had to divide the sums of each column, like this:

 

net_margin = DIVIDE( SUM('Table Name'[Net revenue]); SUM('Datos brutos'[Sales]); 0)

 

Thanks again 

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @carlosflores,

 

I' m not think you can simply nested sumx function with other measures, power bi will drill and calculate on detail level instead of direct calculated on summarized result.

 

For this scenario, you need to manually summary table and add new column with specific calculate formula, then calculate on new column.

Optimizing DAX expressions involving multiple measures

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

How about this measure

 

=[Net Revenue]/[Sales]

 

Does this work?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks everyone. I figured it out watching some tutorials and learning how measures work, I had to divide the sums of each column, like this:

 

net_margin = DIVIDE( SUM('Table Name'[Net revenue]); SUM('Datos brutos'[Sales]); 0)

 

Thanks again 

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.