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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
mramstead1
Frequent Visitor

Filtering Visual to only show Accounts with two Criteria

Hello,

 

I am trying to throw together a quick matrix to identify accounts that may have switched their billing method. Below is a snapshot of the matrix I have:

mramstead1_0-1678902602461.png

 

The goal is to create a measure that I could throw onto the visual as a filter that would keep any accounts that have both Agency and Direct BillModes while removing the others that only include one. I've tried different various different DAX formulas to try and solve this to no avail. 

 

For extra clarity (in case it matters), each Account will have anywhere from 1-50+ lines that get combined into either Direct or Agency BillMode.

 

Any help on this is greatly appreciated!

1 ACCEPTED SOLUTION
KNP
Super User
Super User

It's a little difficult to be certain with the info provided, can I suggest you post some sample data next time that closely represents your actual data.

 

Something like this may work. It may need an additional step to SUMMARIZE the mode if I'm misunderstanding the data.

Let me know if you have questions.

 

Filter = 
VAR vfilter =
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Account],
            "cr",
                COUNT ( 'Table'[Account] ) > 1
        ),
        [cr]
            = TRUE ()
    )
VAR vAccounts =
    SUMMARIZE (
        vfilter,
        'Table'[Account]
    )
RETURN
    IF (
        MIN ( 'Table'[Account] )
            IN vAccounts,
        1
    )
Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

View solution in original post

3 REPLIES 3
mramstead1
Frequent Visitor

Thank you! I didn't post the file due to client data existing within it but I will try and make sample data in the future.

Ashish_Mathur
Super User
Super User

Hi,

So in the visual that you have shared, only the first and last accounts should appear in the result.  Am i correct?  If yes, then share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
KNP
Super User
Super User

It's a little difficult to be certain with the info provided, can I suggest you post some sample data next time that closely represents your actual data.

 

Something like this may work. It may need an additional step to SUMMARIZE the mode if I'm misunderstanding the data.

Let me know if you have questions.

 

Filter = 
VAR vfilter =
    FILTER (
        SUMMARIZE (
            'Table',
            'Table'[Account],
            "cr",
                COUNT ( 'Table'[Account] ) > 1
        ),
        [cr]
            = TRUE ()
    )
VAR vAccounts =
    SUMMARIZE (
        vfilter,
        'Table'[Account]
    )
RETURN
    IF (
        MIN ( 'Table'[Account] )
            IN vAccounts,
        1
    )
Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.