Forum Discussion

Leigh_123's avatar
Leigh_123
Frequent Visitor
3 years ago
Solved

SUMX with Distinct count on different column

Hi all,   I have calculation that i have created from online research that counts string column ('Query1'[Business(es) Area]) and filters by a predefined table 'Business area filter':   I want to...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Leigh_123 ,

    Please have a try.

    Business area =
    VAR __SearchTerms =
        ADDCOLUMNS (
            'Business area filter',
            "Count",
                COUNTROWS (
                    FILTER (
                        'Query1',
                        FIND ( 'Business area filter'[Business Area reference],'Query1'[Your column name],, 0 ) > 0
                    )
                )
        )
    RETURN
        SUMX ( DISTINCT(__SearchTerms, 'Query1'[Your column name]), [Count] )

     

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.