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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
LearnToFly
Frequent Visitor

Not sure how to rewrite...

TransferDate =
VAR DeptMatch = --If the transaction date column is not blank, this counts the number of  matches it has between departments
    CALCULATE(
        COUNTROWS(FILTER('ICS_PhoneExt_8x8', 'ICS_PhoneExt_8x8'[8E_TransDate] <> BLANK())),
        'ICS_PhoneExt_8x8'[8E_Dept] = 'Call Detail Record'[Departments]
    ) > 0

VAR ExtMatch = --If the transfer date column is not blank, this comparecounts the number of matches of 8x8 extension with the current extension being used in 8x8
    CALCULATE(
        COUNTROWS(FILTER('ICS_PhoneExt_8x8', 'ICS_PhoneExt_8x8'[8E_TransDate] <> BLANK())),
        'ICS_PhoneExt_8x8'[8E_Ext] = VALUES('Call Detail Record'[AA_Destination])
    ) > 0

RETURN  --if true it uses original data from the Call Detail Record, however if false it uses the ICS PhoneExt_8x8 table data.
    IF(
        DeptMatch,
        'Call Detail Record'[Departments],
        IF(
            ExtMatch,
            'Call Detail Record'[AA_Destination],
            IFERROR(
                VALUES('ICS_PhoneExt_8x8'[8E_Dept]),
                VALUES('ICS_PhoneExt_8x8'[8E_Ext])
            )
        )
    )
This code returns the error that the expression contains columns from multiple tables, but only columns from a single table can be used in a True/False expression that is used as a table filter expression.  I tried to comment my code so you could understand my intention as well.
 
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Replace 

'ICS_PhoneExt_8x8'[8E_Ext] = VALUES('Call Detail Record'[AA_Destination])

with

'ICS_PhoneExt_8x8'[8E_Ext] IN VALUES('Call Detail Record'[AA_Destination])

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

Replace 

'ICS_PhoneExt_8x8'[8E_Ext] = VALUES('Call Detail Record'[AA_Destination])

with

'ICS_PhoneExt_8x8'[8E_Ext] IN VALUES('Call Detail Record'[AA_Destination])

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.