Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi, I need to fix this code DAX to exibit the last image below:
% Share vendas brutas Agrupável =
VAR AllVendasBrutas =
CALCULATE ( [Vendas Brutas], ALL ( dLocalidades ) )
RETURN
DIVIDE ( [Vendas Brutas], AllVendasBrutas )
Before:
I need the measure to show the share like this image bellow
The share for continent is working, but I need that the share for category shows values that sum is 100%
Any doubts, reply this post. Thanks
Solved! Go to Solution.
To achieve this, you can use a different approach for calculating the % Share vendas brutas Agrupável for categories. You want the sum of this measure to be 100% for each category. Here's a modified version of your DAX code:
% Share vendas brutas Agrupável =
VAR AllVendasBrutas =
CALCULATE([Vendas Brutas], ALL(dLocalidades))
VAR TotalSalesByCategory =
CALCULATE([Vendas Brutas], ALLEXCEPT('YourTable', 'YourTable'[Category]))
RETURN
DIVIDE([Vendas Brutas], IF(ISFILTERED('YourTable'[Category]), TotalSalesByCategory, AllVendasBrutas))
To achieve this, you can use a different approach for calculating the % Share vendas brutas Agrupável for categories. You want the sum of this measure to be 100% for each category. Here's a modified version of your DAX code:
% Share vendas brutas Agrupável =
VAR AllVendasBrutas =
CALCULATE([Vendas Brutas], ALL(dLocalidades))
VAR TotalSalesByCategory =
CALCULATE([Vendas Brutas], ALLEXCEPT('YourTable', 'YourTable'[Category]))
RETURN
DIVIDE([Vendas Brutas], IF(ISFILTERED('YourTable'[Category]), TotalSalesByCategory, AllVendasBrutas))
It didn't work, but with a slightly change it works
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |