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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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