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])))
Anonymous
2 years agoNot applicable
Hi ksharpes , aduguid, thank you for your prompt reply!
Use the ALLSELECTED function to get the year in slicer:
Total Cogs % = DIVIDE(
SUM('EPOS'[Dispatched COGS]),
CALCULATE(SUM('EPOS'[Dispatched COGS]), ALLSELECTED('EPOS'[Year]))
)
If the code still doesn't work, please provide more example data (including tables, relationship, etc.) for better testing.
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.