Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 😞
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
104 | |
69 | |
48 | |
41 | |
34 |
User | Count |
---|---|
164 | |
112 | |
62 | |
54 | |
38 |