Hi,
Can somebody help me please 🙂
I'm trying to calculate SG&A % of sales by function for every country but I'm not able to calculate it correctly. I'm using:
Cost Center Function | Country | Account Category | Value |
F one | Italy | Sales | 1222 |
F two | Italy | SG&A | 12 |
F three | France | Cost to Serve | 23 |
Solved! Go to Solution.
Hi @MARS_5676 ,
I have created a data sample:
So according to this: I'm trying to calculate SG&A % of sales by function for every country
If the desired output is ——for Italy: = 12/ 1222 ; for France: =15/ 67 ,please try:
Measure =
var _sga=CALCULATE(SUM('Table'[Value]),FILTER('Table',[Country]=MAX('Table'[Country]) && [Account Category]="SG&A"))
var _all=CALCULATE(SUM('Table'[Value]),FILTER('Table',[Country]=MAX('Table'[Country]) && [Account Category]="Sales"))
RETURN DIVIDE(_sga,_all)
If you are still confused about it, please provide me with more details about your problem/expected output to help us clarify your scenario.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @MARS_5676 ,
I have created a data sample:
So according to this: I'm trying to calculate SG&A % of sales by function for every country
If the desired output is ——for Italy: = 12/ 1222 ; for France: =15/ 67 ,please try:
Measure =
var _sga=CALCULATE(SUM('Table'[Value]),FILTER('Table',[Country]=MAX('Table'[Country]) && [Account Category]="SG&A"))
var _all=CALCULATE(SUM('Table'[Value]),FILTER('Table',[Country]=MAX('Table'[Country]) && [Account Category]="Sales"))
RETURN DIVIDE(_sga,_all)
If you are still confused about it, please provide me with more details about your problem/expected output to help us clarify your scenario.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@MARS_5676 , Try a measure like
divide( calculate(sum(Table[Value]), [Account Category] = "SG&A"),calculate(sum(Table[Value]), [Account Category] = "Sales"))
Thank you!
Unfortunatelly it's not working, I can see only total divided by total for some reason 😞
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!
User | Count |
---|---|
339 | |
96 | |
61 | |
49 | |
47 |
User | Count |
---|---|
324 | |
118 | |
81 | |
68 | |
63 |