Forum Discussion

siontk's avatar
siontk
New Member
6 years ago
Solved

Current Month Vs Last Month Bar Graph

Hi,

 

I have a bar graph that successfully shows current month vs last month data by product.

 

Problem I have is there is 1 product where current month value is 0 but i know contains last month, and this is not showing in the graph at all.

 

Example

                    Current Month    Previous Month

Product A            1                         2

Product B             2                         3

Product C            0                        5                      <<--- This is not showing on the graph.

 

Setup is I have a month page filter and a measure to extract prevous month data.

 

Thanks

Sion

  • Hi siontk ,

    To use time intelligence function, you'd better have a separate date table to use.

    Or you can create measure like this if you just have a single table without using time intelligence function:

    Current month = 
    CALCULATE(
        SUM('Table'[Sales]),
        MONTH('Table'[date]) = MONTH(TODAY())
    )
    
    Previous month = 
    CALCULATE(
        SUM('Table'[Sales]),
        MONTH('Table'[date]) = MONTH(TODAY()) -1
    )

     

    Best Regards,
    Yingjie Li

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

     

     

4 Replies