Forum Discussion
conditional percentage using DAX
- 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
A couple of things here that are going to cause you problems later ...
1. You probably don't want to have the grand totals included in your data
2. You probably want to create a measure for this instead of a calculated column
Perhaps. I tried other solutions but nothing worked easily. I think separating aggregate from detail column was useful idea. It make my job much easier now, without bringing Calculated column
- v-huizhn-msft9 years agoMicrosoft Employee
Hi vishal_singh,
Have you resolved your problem? It's helpful to mark the corresponding solution as mark if you have reslove the issue, or post your solution.
Best Regards,
Angelia