Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need some help and guidance please.
I have the below table with an Employee, Manager, and sales. For every manager there is a Supervisor and as you will see there is $0 sales for each of the supervisors. The Supervisors totals are measured on all the sales done by their team i.e.: Employee “D” should have a total sales value of $2170 similarly Employee “O” should have a total sales amount of $1993.
I can’t use an IF or a SWITCH formula as I cannot reference the Employee in the formula.
Sales with Supervisor =
IF(
'Dim Employee'[Employee] = "D", --This produces and error which is expected
[Sales AB],
[Sales]]
)
How can I get the total sales per manager to reflect for the respective Supervisor and for the rest of the employees their normal sales?
Solved! Go to Solution.
Hi , @Charles-C
According to your description, you want to calculate the "Supervisor" sales.
Here are the steps you can refer to :
(1)If you want to show in the measure , you just need to put the fields on the visual. And you can use this measure to show the Supervisor Name:
Manager Name = CALCULATE( MAX('Table'[Employee]) , 'Table'[Role]="Supervisor")
(2)If you want to create a calcualted column in your table , you can use this dax code:
Column = var _cur_manager =[Manager]
var _sum = SUMX(FILTER('Table','Table'[Manager] = _cur_manager) , [Sales])
return
IF([Role]="Supervisor" ,_sum ,[Sales])
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @Charles-C
According to your description, you want to calculate the "Supervisor" sales.
Here are the steps you can refer to :
(1)If you want to show in the measure , you just need to put the fields on the visual. And you can use this measure to show the Supervisor Name:
Manager Name = CALCULATE( MAX('Table'[Employee]) , 'Table'[Role]="Supervisor")
(2)If you want to create a calcualted column in your table , you can use this dax code:
Column = var _cur_manager =[Manager]
var _sum = SUMX(FILTER('Table','Table'[Manager] = _cur_manager) , [Sales])
return
IF([Role]="Supervisor" ,_sum ,[Sales])
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @v-yueyunzh-msft,
Thank you for the reply and the solution, the calculated column worked. In my actual scenario I had to create a Summarized table and then add the calculated column but in all the issue has been resolved.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |