Forum Discussion

dashmarley11's avatar
dashmarley11
Helper III
1 year ago
Solved

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

  • Thankyou, ajohnso2techies, for your response.

    Hi dashmarley11,

    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.

6 Replies

  • ajohnso2's avatar
    ajohnso2
    Solution Supplier

    if(PrevFtp2 = 0, 0, if(CurrFtp2 = 0, PrevFtp2/PrevBook2, PrevFtp1/PrevBook1 - PrevFtp2/PrevBook2))

  • Hi dashmarley11 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)
                )
            )
    )
  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Thankyou, ajohnso2techies, for your response.

    Hi dashmarley11,

    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.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi dashmarley11,

    We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

    If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

    Thank you.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi dashmarley11,

    We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

    If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

    Thank you.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi dashmarley11,

    We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

    If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

    Thank you.