Forum Discussion

BieBel's avatar
BieBel
Helper I
11 months ago
Solved

Measure counting rows, grouped by two different colums

Hi, I have al table with order information. I can easily create a visual showing me the number of ORDER_ID by SALES_REGION and by MONTH_OF_ORDER_DATE But I need to create a measure that gives me th...
  • danextian's avatar
    11 months ago

    Hi BieBel 

     

    DISTINCTCOUNT ('table'[ORDER ID] should be okay if the ID doesn't repeat in other region or months.  However, if the same ORDER ID can be re-used, try

    COUNTROWS (  
        SUMMARIZE (
            -- Create a table of distinct combinations of the following columns:
            'table'[ORDER ID],           -- Unique order identifier
            'table'[SALES_REGION],       -- Region where the order was made
            'table'[MONTH_OF_ORDER_DATE] -- Month of the order date
        )
    )