cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cosminc Member
Member

DAX multiple table filters intersection

Hi all,

i have a base like below and need to create a measure with multiple filters intersection like this:

VAR

_first_filter all ID where Label = A and Value = 1

_second_filter all ID where Label = B and Value = 1

_third_filter all ID where Label = C and Value = 1

RESULT

and need to countrows of source from below with filters Label = C &&  all common ID between the 3 filter tables from above

 

Thanks in advance,

Cosmin

 

 
IDLabelValueClient
1A1cosmin
1B1cosmin
1C1cosmin
2A0cosmin
2B1cosmin
2C1cosmin
3A0cosmin
3B1cosmin
3C0cosmin
4A1cosmin
4B1cosmin
4C0cosmin
5A1cosmin
5B0cosmin
5C999cosmin
1A1marius
1B0marius
1C1marius
2A0marius
2B1marius
2C1marius
3A0marius
3B1marius
3C0marius
4A1marius
4B0marius
4C1marius
5A0marius
5B1marius
5C0marius
2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: DAX multiple table filters intersection

Hi @cosminc ,

 

Please refer to below measure:

Count_rows =
VAR temp_tab =
    ADDCOLUMNS (
        Sample4,
        "Label number", CALCULATE (
            DISTINCTCOUNT ( Sample4[Label] ),
            ALLEXCEPT ( Sample4, Sample4[ID] ),
            Sample4[Value] = 1
        )
    )
RETURN
    COUNTROWS ( FILTER ( temp_tab, [Label number] = 3 && [Label] = "C" ) )

3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

cosminc Member
Member

Re: DAX multiple table filters intersection

Perfect!

Thanks,

Cosmin

View solution in original post

2 REPLIES 2
v-yulgu-msft Super Contributor
Super Contributor

Re: DAX multiple table filters intersection

Hi @cosminc ,

 

Please refer to below measure:

Count_rows =
VAR temp_tab =
    ADDCOLUMNS (
        Sample4,
        "Label number", CALCULATE (
            DISTINCTCOUNT ( Sample4[Label] ),
            ALLEXCEPT ( Sample4, Sample4[ID] ),
            Sample4[Value] = 1
        )
    )
RETURN
    COUNTROWS ( FILTER ( temp_tab, [Label number] = 3 && [Label] = "C" ) )

3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

cosminc Member
Member

Re: DAX multiple table filters intersection

Perfect!

Thanks,

Cosmin

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 335 members 3,089 guests
Please welcome our newest community members: