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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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