Forum Discussion
Use a calculated measure with a condition
- 3 years ago
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.