Forum Discussion

Surendra_thota's avatar
9 years ago
Solved

How to add Missing rows and add zero % for missing rows

Hi All   we are gettig data from the table for every month , if  some month is missing we need add row . for example  Reading towards complaince / Monthly Frequency Target = complaince%   ( >100% ...
  • v-jiascu-msft's avatar
    9 years ago

    Hi Surendra_thota,

     

    These missing months don't exist, so let's create them. (Modeling -> New Table -> input this formula)

    Date =
    DISTINCT (
        SELECTCOLUMNS (
            CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2017, 12, 31 ) ),
            "Month1", EOMONTH ( [Date], 0 )
        )
    )

    Create a relationship from "Month1" to "month";

    Then join the two tables together.

    Table 2 =
    NATURALLEFTOUTERJOIN ( 'Date', 'Table1' )

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale