Forum Discussion

ask4atish's avatar
ask4atish
Advocate III
6 years ago
Solved

Count blank in matrix

Hi, I have columns in my table as mentioned below. Date Associate consumers 01-09-2019 A 120104000020 01-09-2019 A 120104000038 01-09-2019 A 120104000046 01-09-2019 D ...
  • v-lili6-msft's avatar
    v-lili6-msft
    6 years ago

    hi ask4atish 

    For your case, you must have a dim date table and create the relationship with fact table by date column.

    then use [Date] from this dim table in [Columns] of matrix visual.

    Here is detail steps, you could refer to:

    Step1:

    Use CALENDAR Function to create a dim date table, eg.

    Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

    Step2:

    Create the relationship with fact data table.

    Step3:

    Create two measure that

    WORKING DAYS = IF(ISFILTERED('Date'[Date]),COUNTA('Table'[consumers]),DISTINCTCOUNT('Table'[Date]))
    
    TOTAL DAYS = CALCULATE(COUNTA('Date'[Date]))

     

    and here is sample pbix file, please try it.

     

    Regards,

    Lin