Forum Discussion
vishal_singh
9 years agoFrequent Visitor
conditional percentage using DAX
I have a table with given columns and data: CustType Class values Active Customers COM 100671 Active Customers RES 272733 X...
- 9 years ago
Hi vishal_singh,
Please click the table, Right click->Edit Query, select Triangle (highlighted in red line) in the Class column field. After order class, the same class will be together as follows.
Then create calculated columns using the following formulas and get expected result.sum of class = CALCULATE(SUM(Table14[values]),ALLEXCEPT(Table14,Table14[Class]))-Table14[values]
Percentage = IF(Table14[CustType]="Active Customers",1,DIVIDE(Table14[values],Table14[sum of class]))
If you have any other question, please let me know.
Best Regards,
Angelia
Baskar
9 years agoResident Rockstar
Here u have to create calculated Column that will give the expected result .
Column = var cur_class = Class
var Max_values = calculate(Max(Values), filter(Table_Name, Class=cur_class)
return values / Max_Values
Note : Bold letters u have replace your related names
once create the column change the Format to Percentage under in modelling screen ..
It will help u , if not let me know