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.
Greetings Community. I'm having troubles with a KPI showing a measure
Ihave a table like this (with a bunchof rows):
I have a Slicer with all the clients and another Slicer to filter the months like this:
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,
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.
Solved! Go to 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
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
Hi,
How about this measure
=[Net Revenue]/[Sales]
Does this work?
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |