Forum Discussion

sambou's avatar
sambou
Frequent Visitor
9 years ago
Solved

How to compare two date columns on the same chart

Hi There,   is there a way to create a chart/table in Power BI similar to the table below? to compare the revenue from two different weeks on the same table? I’m trying to pull data from SQL Server...
  • v-sihou-msft's avatar
    9 years ago

    sambou

     

    We can create a measure to get the difference of two selected dates.

     

    Difference =
    CALCULATE (
        SUM ( Table1[Value] ),
        FILTER ( ALLSELECTED ( Table1[Date] ), Table1[Date] = MAX ( Table1[Date] ) )
    )
        - CALCULATE (
            SUM ( Table1[Value] ),
            FILTER ( ALLSELECTED ( Table1[Date] ), Table1[Date] = MIN ( Table1[Date] ) )
        )

    However, We can't have this measure appeared on Grand Total level only. It will always appear under each column group. 

     

     

    So I suggest you create another table visual, and bring Region field and Difference measure only. 

     

    Regards,