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
techgirlangle
Frequent Visitor

Need help to build measure with filter switch based on user uploaded list

I need help with building a DAX measure to count list of loans that are existing + any new eligible loans. Eligible loans are calculated with a different measure. User has an option to upload a list of new loans to be included for check. Default behaviour is user has not supplied an inclusion list then include existing + all fitting criteria or include existing + user selected. I am looking at adding the false part for switch statement but can't get it working. I don't feel I am doing it correct. What should be the right way to achieve this. Thanks

CountOfLoans =
CALCULATE (
    COUNT ( 'table'[Loanid] ),
    FILTER('table',
            AND(
                OR('table'[Filter1] = "Existing",
                    SWITCH(ISEMPTY(TaggedLoanPool),
                        TRUE(),
                        AND(
                            'table'[Filter1] = "New",
                            'Measures'[Eligible] = "Yes"
                        ),
                       FALSE(),
                        'table'[Loanid] = TaggedLoanPool[loanid]
                    )
                ),
                'table'[Current balance] > 0
            )
        )
    )
1 ACCEPTED SOLUTION
techgirlangle
Frequent Visitor

I have found a possible solution. The issue was even though I had build a relationship between the two datasets it was still coming up as limited relationship which was not allowing to use RELATED function and because of various different criteria I couldn't use RELATEDTABLE. I have resolved by using VALUES function with IN operator.

View solution in original post

1 REPLY 1
techgirlangle
Frequent Visitor

I have found a possible solution. The issue was even though I had build a relationship between the two datasets it was still coming up as limited relationship which was not allowing to use RELATED function and because of various different criteria I couldn't use RELATEDTABLE. I have resolved by using VALUES function with IN operator.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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