Search code examples
powerbipowerbi-desktop

Slicer doesn't show column with zero value


I have a simple table:

Date                   Sex  Value
Sunday 1 January 2023   M   11
Sunday, 1 January 2023  F   25
Țuesday 10 January 2023 M   45
Țuesday 10 January 2023 F   5
Friday, 20 January 2023 M   10

A matrix with a slicer shows:

And on the 20 January it shows only male:

But i like to see it with "F" column with 0 values. How can I do that?


Solution

  • You need the following:

    1. Create a new Table for the Sex dimension - like
    Sex
    F
    M
    1. Add a relationship from this new table (Dim Sex) to your data table

    2. Create a new Measure:

    Total = COALESCE(SUM('your table'[Value]), 0)
    
    1. Update your matrix to use the 'Dim Sex'[Sex] for the Columns, and the new Total measure for the matrix value.