Forum Discussion
Wrong calculation if adding column in table in Power BI
- 4 years ago
Hi, Analitika
This part of your formula should be problematic.
VAR summaryTable = ADDCOLUMNS ( VALUES ( tb[OPALGA_MEN] ), "@val", DIVIDE ( [total_sum_tb], [sum_hs_tb] ) )Depending on the data you provide, the dates are the same and such a result will appear.
So the result of summation is not quite right.
You can try the following methods.
total/hs_tb = Var _table=SUMMARIZE('Table','Table'[Date],'Table'[sum1],"val",DIVIDE([total_sum_tb],[sum_hs_tb])) Var _sum=SUMX(_table,[val]) Return IF(ISINSCOPE('Table'[Date]),DIVIDE([total_sum_tb],[sum_hs_tb]),_sum)'Table'[sum1] This represents a column of unique values that will not be deduplication.At this time, whether you add OBJ_KOD column or not, the result will not change.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Analitika
This part of your formula should be problematic.
VAR summaryTable =
ADDCOLUMNS (
VALUES ( tb[OPALGA_MEN] ),
"@val", DIVIDE ( [total_sum_tb], [sum_hs_tb] )
)
Depending on the data you provide, the dates are the same and such a result will appear.
So the result of summation is not quite right.
You can try the following methods.
total/hs_tb =
Var _table=SUMMARIZE('Table','Table'[Date],'Table'[sum1],"val",DIVIDE([total_sum_tb],[sum_hs_tb]))
Var _sum=SUMX(_table,[val])
Return
IF(ISINSCOPE('Table'[Date]),DIVIDE([total_sum_tb],[sum_hs_tb]),_sum)
At this time, whether you add OBJ_KOD column or not, the result will not change.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.