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
KrisIsLearning
Frequent Visitor

Filtering data in DAX with a related table

I know how to do it with M but want to get more into DAX syntax but I need a few hints from the community.

 

I've got 2 tables set up:

 

KnownRubrics

RubriekCondition

aardok
wgnrnok
testok

 

and Reports:

IdRubriek

1aard
1wgnr
1bla
2aard

 

I created already several quick measures like the following:

 
Count of Rubriek for ok =
CALCULATE(
    COUNTA('Reports'[Rubriek]),
    'KnownRubrics'[Condition] IN { "ok" }
)
 
and 
 
List of Rubriek values =

        CONCATENATEX(
            VALUES('Reports'[Rubriek]),
            'Reports'[Rubriek],
            ", ",
            'Reports'[Rubriek],
            ASC
        )
 
 
What I'm after is 3 columns that give me the concatenated string when in the related table it's an ok and another table with all the concatenated text when it's nok. Also another one when there's no corresponding value in the KnownRubrics table.
 
Expected result:
 
IdCountOkCountNokCountUnknownListOkListNokListUnknown
1111aardwgnrbla
2100aard  
1 ACCEPTED SOLUTION
KrisIsLearning
Frequent Visitor

I'm getting into the correct direction:

 

        CONCATENATEX(
            FILTER(
                'Reports',
                'Reports'[Rubriek] = RELATED(KnownRubrics[Rubriek])
            )
            ,
            'Reports'[Rubriek],
            ", ",
            'Reports'[Rubriek],
            ASC
        )

View solution in original post

3 REPLIES 3
KrisIsLearning
Frequent Visitor

I'm getting into the correct direction:

 

        CONCATENATEX(
            FILTER(
                'Reports',
                'Reports'[Rubriek] = RELATED(KnownRubrics[Rubriek])
            )
            ,
            'Reports'[Rubriek],
            ", ",
            'Reports'[Rubriek],
            ASC
        )
FreemanZ
Super User
Super User

hi @KrisIsLearning ,

 

could you provide the expected result as a table as well?

I updated the original post.

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!

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.