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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
cosminc
Post Partisan
Post Partisan

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
v-yulgu-msft
Employee
Employee

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

Perfect!

Thanks,

Cosmin

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
Employee

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.

Perfect!

Thanks,

Cosmin

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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