Forum Discussion
Percentage value is incorrect while dividing Calculated columns
- 1 year ago
Kumar_0606 Instead of creating a calculated column for the division, it's better to create a measure. Measures are more dynamic and can handle aggregations better.
DAX
Measure1 = SUM ( Table[CalculatedColumn1] )
Measure2 = SUM ( Table[CalculatedColumn2] )PercentageMeasure = DIVIDE ( [Measure1], [Measure2], 0 )
If you want to create a measure that sums values based on conditions, you should use the CALCULATE function.
DAX
Measure1 = CALCULATE (
SUM ( Table[Value] ),
Table[Version] = "New",
Table[Code] = "ABC",
Table[Year] < 2022
)
Kumar_0606 Instead of creating a calculated column for the division, it's better to create a measure. Measures are more dynamic and can handle aggregations better.
DAX
Measure1 = SUM ( Table[CalculatedColumn1] )
Measure2 = SUM ( Table[CalculatedColumn2] )
PercentageMeasure = DIVIDE ( [Measure1], [Measure2], 0 )
If you want to create a measure that sums values based on conditions, you should use the CALCULATE function.
DAX
Measure1 = CALCULATE (
SUM ( Table[Value] ),
Table[Version] = "New",
Table[Code] = "ABC",
Table[Year] < 2022
)
- Kumar_06061 year agoHelper I
Thanks Bhanu.