Forum Discussion

manishbeniwal's avatar
manishbeniwal
Frequent Visitor
7 years ago
Solved

How to show missing month in chart

Please suggest how to get missing month in this chart. This is 12 month data, but if there is no data power bi not showing month for that.

  • Hi manishbeniwal 

    You may try to create a measure with IF Fuction like below:

    Measure =
    IF (
        MAX ( 'Table'[date] ) <= DATE ( 2019, 3, 31 )
            && MAX ( 'Table'[date] ) >= DATE ( 2018, 4, 30 ),
        SUM ( 'Table'[Amount] ) + 0
    )
    

    Regards,

4 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi manishbeniwal 

    In the Visualisation Pane right click on your filed (Year Month) and select Show items with no data as below.

     

    Hope this helps
    Mariusz

    • manishbeniwal's avatar
      manishbeniwal
      Frequent Visitor

      By this feature it is showing all 2018 and 2019 months in X-axis. I want to start X-axis from Apr 2018 and last month will be Mar-19.

      • tex628's avatar
        tex628
        Icon for Community Champion rankCommunity Champion

        Add +0 to your sum. 

        Measure = Sum(Table[Amount]) + 0



  • v-cherch-msft's avatar
    v-cherch-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi manishbeniwal 

    You may try to create a measure with IF Fuction like below:

    Measure =
    IF (
        MAX ( 'Table'[date] ) <= DATE ( 2019, 3, 31 )
            && MAX ( 'Table'[date] ) >= DATE ( 2018, 4, 30 ),
        SUM ( 'Table'[Amount] ) + 0
    )
    

    Regards,