Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 123 | |
| 99 | |
| 67 | |
| 49 |