Forum Discussion
MarcinSz
3 years agoFrequent Visitor
Calculation groups - gap calculation
Hi all, I have an issue with calculation groups. I've created calculation groups for P&L lines and put them to Matrix. Please have look at the snapshoot. My problem is that when I am calculating...
SamInogic
2 years agoSuper User
Hi MarcinSz ,
You can try with below Dax expression which converts the percentage values (text to divisible number) into numbers, so that Power BI Dax can perform the Calculations.
Difference_Text =
VAR fctValue = IF([Name] = "%GROSS PROFIT", VALUE(SUBSTITUTE([FCT], "%", "")) / 100, [FCT])
VAR pfctValue = IF([Name] = "%GROSS PROFIT", VALUE(SUBSTITUTE([PFCT], "%", "")) / 100, [PFCT])
VAR differenceValue = fctValue - pfctValue
RETURN
IF([Name] = "%GROSS PROFIT",
FORMAT(differenceValue, "0.0%"),
FORMAT(differenceValue, "General Number")
)
Please refer to the screenshot given below,
Thanks!