Forum Discussion
ksharpes
2 years agoNew Member
Total Sales % Card based on Slicer Selection
Hi All, just started using Power BI so apologies if this is a basic question! I have created a Card with the following formula to show a percentage of sales vs total Sales, but I would like ...
- 2 years ago
Thanks for the help, I have figured it out:
Total Cogs % = DIVIDE(SUM('Amazon Week EPOS'[Dispatched COGS]),CALCULATE(SUM('Amazon Week EPOS'[Dispatched COGS]), ALLEXCEPT('Amazon Week EPOS','Amazon Week EPOS'[Week End].[Year])))
aduguid
Memorable Member
2 years agoTry this measure
Total Cogs % =
DIVIDE(
SUM('EPOS'[Dispatched COGS]),
CALCULATE(
SUM('EPOS'[Dispatched COGS]),
REMOVEFILTERS('EPOS'[Year])
)
)ksharpes
2 years agoNew Member
Doesnt seem to work, I want to include the selection from the Year slicer.
I currently have 2 values for Year 2023 or 2024
so in theory the sum would be Dispatched Cogs (2023) / Total Dispatched COGS (2023)
- aduguid2 years ago
Memorable Member
In that case try these measures
Dispatched Cogs = CALCULATE( SUM('YourTable'[Dispatched Cogs]), 'YourTable'[Year] = SELECTEDVALUE('Year'[Year]) ) Total Dispatched COGS = CALCULATE( SUM('YourTable'[Total Dispatched COGS]), 'YourTable'[Year] = SELECTEDVALUE('Year'[Year]) ) Dispatched Cogs Ratio = DIVIDE( [Dispatched Cogs], [Total Dispatched COGS] )- ksharpes2 years agoNew Member
Sorry still not working, I may have confused the issue slightly, for the [Total Dispatched COGS] I was using the calculation
"calculate(sum('Amazon Week EPOS'[Dispatched COGS]), all())"can the "Selectedvalue" art be included in the above?"SELECTEDVALUE('Amazon Week EPOS'[Week End].[Year]) )"