Forum Discussion
Anonymous
1 year agoNot applicable
Report Builder Nested If
I need to build a nested "If" Sum calculation that follows this logic: If PrevFtp2 =0 THEN 0 If CurrFtp2 =0 THEN PrevFtp2/PrevBook2 Else PrevFtp1/PrevBook1 - PrevFtp2/PrevBook2
- 1 year ago
Thankyou, ajohnso2, techies, for your response.
Hi Anonymous,
We appreciate your inquiry posted on the Microsoft Fabric Community Forum.
Further to the response provided by techies , please find attached the screenshot and the PBIX file, which may assist in resolving the issue:
If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will help other community members facing similar queries.
Thank you.
techies
1 year agoSuper User
Hi Anonymous please check this
nested if example =
SUMX (
Data,
VAR _PrevFtp2 = Data[PrevFtp2]
VAR _CurrFtp2 = Data[CurrFtp2]
VAR _PrevFtp1 = Data[PrevFtp1]
VAR _PrevBook1 = Data[PrevBook1]
VAR _PrevBook2 = Data[PrevBook2]
RETURN
IF (
_PrevFtp2 = 0,
0,
IF (
_CurrFtp2 = 0,
DIVIDE(_PrevFtp2, _PrevBook2),
DIVIDE(_PrevFtp1, _PrevBook1) - DIVIDE(_PrevFtp2, _PrevBook2)
)
)
)