Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Amount is not populated correctly with multiple conditions

I have two file in Power BI, one is claims list and one is incident register.

 

I created "Updated Claim Amount" column with DAX Function as per below:

Updated Claim Amount =
VAR CurrentQBE = 'Incident Register'[QBE Number]
RETURN
    IF(
        ISBLANK(CurrentQBE),
        [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        IF(
            SELECTEDVALUE('Claims List'[Claim Status]) = "No Claim",
            SUMX('Incident Register', [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage]),
            IF(
                ISBLANK(LOOKUPVALUE('Claims List'[Total Incurred Net],'Claims List'[Broker Ref],'Incident Register'[QBE Number])),
                0,  
                LOOKUPVALUE('Claims List'[Total Incurred Net],'Claims List'[Broker Ref],'Incident Register'[QBE Number])
            )
        )
    )

 

Everything works fine except when the outcome is 'QBE is not blank' and the claim status is 'no claim.' It should add 'Cost to Keenan Repair/Recovery' + 'Incident Register'[Cost to TP/property damage], but it shows as 0.

 

Sample data from claims list report:

Broker RefClaim StatusTotal Incurred Net
QBE04029610Open£1,999.00
QBE04029947Open£5,398.00
QBE04028368No Claim£0.00
QBE04027518Open£13,142.90
QBE04022177Open£3,999.00
QBE04021461Open£7,211.02
QBE04020829Open£7,921.92
QBE04024895Open£5,039.00
QBE04020898Open£1,999.00
QBE04021906Fault£1,890.00
QBE04017127Open£5,348.57

 

Sample date from incident register:

QBE NumberCost to Keenan Repair/RecoveryCost to TP/property damage
 1,932.91 
 3,599 
   
QBE04008099/QBE04008142  
QBE04017127  
QBE04021906  
QBE04024895  
QBE04020898  
QBE04020829  
QBE04022177  
QBE04021461  
QBE04027518  
QBE04028368  
QBE04029138  
QBE04029610  
QBE04029947  
1 ACCEPTED SOLUTION

 

@Anonymous Hmm, not sure what is going wrong but try this:

 

Updated Claim Amount =
VAR CurrentQBE = 'Incident Register'[QBE Number]
VAR ClaimLookup = LOOKUPVALUE('Claims List'[Total Incurred Net], 'Claims List'[Broker Ref], CurrentQBE)
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(CurrentQBE), [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        SELECTEDVALUE('Claims List'[Claim Status]) = "No Claim", [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        ISBLANK(ClaimLookup), 0,
        SUMX(
            FILTER('Claims List', 'Claims List'[Broker Ref] = CurrentQBE),
            'Claims List'[Total Incurred Net]
        )
    )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

8 REPLIES 8
Greg_Deckler
Community Champion
Community Champion

@Anonymous First, I would change from using nested IF statements to using SWITCH(TRUE(), ...). Will greatly cleanup your code and perhaps make it obvious where things are going awry.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Thanks for your advise. I used switch function but it is having error as "A table of multiple values was supplied where a single value was expected."

 

Updated Claim Amount =
VAR CurrentQBE = 'Incident Register'[QBE Number]
VAR ClaimLookup = LOOKUPVALUE('Claims List'[Total Incurred Net], 'Claims List'[Broker Ref], CurrentQBE)
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(CurrentQBE),
        [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        SELECTEDVALUE('Claims List'[Claim Status]) = "No Claim",
        [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        ISBLANK(ClaimLookup),
        0,
        TRUE(),
        SUMX(
            FILTER('Claims List', 'Claims List'[Broker Ref] = CurrentQBE),
            'Claims List'[Total Incurred Net]
        )
    )

 

@Anonymous Hmm, not sure what is going wrong but try this:

 

Updated Claim Amount =
VAR CurrentQBE = 'Incident Register'[QBE Number]
VAR ClaimLookup = LOOKUPVALUE('Claims List'[Total Incurred Net], 'Claims List'[Broker Ref], CurrentQBE)
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(CurrentQBE), [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        SELECTEDVALUE('Claims List'[Claim Status]) = "No Claim", [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        ISBLANK(ClaimLookup), 0,
        SUMX(
            FILTER('Claims List', 'Claims List'[Broker Ref] = CurrentQBE),
            'Claims List'[Total Incurred Net]
        )
    )

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler thanks for your support but it is still showing error as "A table of multiple values was supplied where a single value was expected."

@Anonymous Just to confirm this is a calculated column and not a measure, correct?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler yes, it is calculated column. 

@Anonymous Well, one thing you can do is to comment out ( // ) individual logical statements in your SWITCH statement until you find the offending statement. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Thanks for your advise. i have fix the error but the initial problem still exist. Everything works fine except when the outcome is 'QBE is not blank' and the claim status is 'no claim.' It should add 'Cost to Keenan Repair/Recovery' + 'Incident Register'[Cost to TP/property damage], but it shows as 0.

 

Updated Claim Amount =
VAR CurrentQBE = 'Incident Register'[QBE Number]
VAR ClaimLookup =
    SUMX(
        FILTER('Claims List', 'Claims List'[Broker Ref] = CurrentQBE),
        'Claims List'[Total Incurred Net]
    )
RETURN
    SWITCH(
        TRUE(),
        ISBLANK(CurrentQBE), [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        SELECTEDVALUE('Claims List'[Claim Status]) = "No Claim", [Cost to Keenan Repair/Recovery] + 'Incident Register'[Cost to TP/property damage],
        ISBLANK(ClaimLookup), 0,
        ClaimLookup
    )

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.