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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
arikofather
Helper I
Helper I

Simple Dax to lookup mapping table and compare with datasets - Updated

I have here a PBIX that helps my previous confusing post.  I need helo to figure out the issues.

 

I have a caculated column to extract a consoliaded status from the mappingt table.   The logic is not pickingup the exact status.  

 

arikofather_0-1757600400472.png\\

*Cal Column Consolidated Status =

    LOOKUPVALUE (
        'aaInvoice Status Mapping Dataset'[Consolidated Display],
        'aaInvoice Status Mapping Dataset'[App - Secondary Review Identifier],           related ('aaCoding App-Automation Prod DS from V'[Secondary Review] ),
        'aaInvoice Status Mapping Dataset'[App - Coding Status/Secondary Review Status], related ('aaCoding App-Automation Prod DS from V'[Status] ),
        'aaInvoice Status Mapping Dataset'[Oracle - coding Status],                      'aaOracle Dataset_V6.0'[Coding Status] ,
        'aaInvoice Status Mapping Dataset'[Oracle - Approval Status],                    'aaOracle Dataset_V6.0'[Approval Status],
        'aaInvoice Status Mapping Dataset'[Oracle - Payment Status],                     'aaOracle Dataset_V6.0'[Paid Status] ,
        'aaInvoice Status Mapping Dataset'[Oracle - On Hold],                            'aaOracle Dataset_V6.0'[On Hold],
        "Invalid Consolidated Status"
    )

 

Community AR.pbix

 

 

1 ACCEPTED SOLUTION

I was able to resolve this by TRIming all the columns of "aaInvoice Status Mapping Dataset".  It turned out that the records were not matching due to whitespace. 

View solution in original post

4 REPLIES 4
rajendraongole1
Super User
Super User

Hi @arikofather - i have created a measure to find the same. 

Please find the attached pbix file.

I am getting "Invalid Status" as output means the LOOKUPVALUE function is running correctly but not finding a matching row in your aaInvoice Status Mapping Dataset table.

 

rajendraongole1_0-1757601950165.png

 

Measure details:

Consolidated Status Measure =
VAR CurrentInvoiceID = SELECTEDVALUE('aaOracle Dataset_V6.0'[Invoice Id])
VAR CodingAppTable =
    CALCULATETABLE (
        'aaCoding App-Automation Prod DS from V',
        'aaCoding App-Automation Prod DS from V'[Invoice Id] = CurrentInvoiceID
    )
RETURN
    IF (
        NOT ISBLANK(CurrentInvoiceID),  -- Check if a single Invoice ID is selected
        CALCULATE (
            LOOKUPVALUE (
                'aaInvoice Status Mapping Dataset'[Consolidated Display],
                'aaInvoice Status Mapping Dataset'[App - Secondary Review Identifier], MAXX(CodingAppTable, [Secondary Review]),
                'aaInvoice Status Mapping Dataset'[App - Coding Status/Secondary Review Status], MAXX(CodingAppTable, [Status]),
                'aaInvoice Status Mapping Dataset'[Oracle - coding Status], SELECTEDVALUE('aaOracle Dataset_V6.0'[Coding Status]),
                'aaInvoice Status Mapping Dataset'[Oracle - Approval Status], SELECTEDVALUE('aaOracle Dataset_V6.0'[Approval Status]),
                'aaInvoice Status Mapping Dataset'[Oracle - Payment Status], SELECTEDVALUE('aaOracle Dataset_V6.0'[Paid Status]),
                'aaInvoice Status Mapping Dataset'[Oracle - On Hold], SELECTEDVALUE('aaOracle Dataset_V6.0'[On Hold]),
                "Invalid Status" -- This is an optional result if a match is not found
            )
        )
    )
 
Hope this works.
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





@rajendraongole1 There are multiple matching rows matching row in the aaInvoice Status Mapping Dataset table.  

I was able to resolve this by TRIming all the columns of "aaInvoice Status Mapping Dataset".  It turned out that the records were not matching due to whitespace. 

Hi @arikofather ,

I'm glad you found a solution and resloved  the query. Thank you very much for sharing here.

If you have further queries please reach out.

 

Thankyou for connecting with Microsoft Community Forum

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.