Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have a matrix grid with the Sales by Country and foreach Country the sales by product category
I want the % of total by Country and that's easy, but obviously when I expand a country the number has no sense...
In the example, I would like to see Seafood is 12,48% of the 26k of Italy
Is such a thing possible?
Thanks
Solved! Go to Solution.
I see, you can test what dimensions are in scope and remove the concext acordingly.
Try this
Measure =
IF(AND(ISINSCOPE('Country'[CountryName]),ISINSCOPE(Products[Category])),
DIVIDE(
[TotalSales],
CALCULATE(
TotalSales,
ALL(Products[Category])
)
),
DIVIDE(
TotalSales,
CALCULATE(
TotalSales,
ALL('Country'[CountryName])
)
)
)
Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
BTW, do you perhaps know why in a new file I have the PLUS sign near every ROW, while in an old pbix (but same, last, version of client) I have the old arrows to expan/collapse all the rows ?
EDIT:
Hi
You are removing the filter context only from the product table. You need to do that for your sales table:
DIVIDE(
[TotalSales],
CALCULATE(
[TotalSales],
ALL(Sales)
)
)
Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
That's better (number now make sense and are related to the gran total), but what I want to achieve is the % respect the parent total...
I see, you can test what dimensions are in scope and remove the concext acordingly.
Try this
Measure =
IF(AND(ISINSCOPE('Country'[CountryName]),ISINSCOPE(Products[Category])),
DIVIDE(
[TotalSales],
CALCULATE(
TotalSales,
ALL(Products[Category])
)
),
DIVIDE(
TotalSales,
CALCULATE(
TotalSales,
ALL('Country'[CountryName])
)
)
)
Kind regards,
José
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos! 🙂
WOW !! only a Kudo is not enough!! Should be a Superkudo button.
Works like a charm... Thanks a lot!
oh sorry, I left in the screenshot and I though it was visible.. anyway it is
Please check the edited messagem above
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
126 | |
113 | |
74 | |
65 | |
46 |