Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measures/calculated column: Monthly value subtract with December last year(baseline)

Hello all,

I am working on to have monthly delta value on my visualization which is in form of table. The delta value is each month sales subtract December 2021 sales.

Need help on how to get those value and how to do visualize each month data in a column.

My data looks like this:

IDNameMonthSales
1JoeDecember 20213000
1JoeJanuary 20225000
1JoeFebruary 20225000
2ImranDecember 20212000
2ImranJanuary 20228000
2ImranFebruary 20227000
3NatalieDecember 20216000
3NatalieJanuary 20229000
3NatalieFebruary 20223000

 

and I hope someone could guide me to have this:

Where we have delta calculate (each month sales-december 2021 sales)

IDNameMonthSalesMonthly Delta
1JoeDecember 20213000 
1JoeJanuary 202250002000
1JoeFebruary 202250002000
2ImranDecember 20212000 
2ImranJanuary 202280006000
2ImranFebruary 202270005000
3NatalieDecember 20216000 
3NatalieJanuary 202290003000
3NatalieFebruary 20223000-3000

 

Then I hope I could visualize this as:

IDNameDecember 2021 SalesJanuary 2022 SalesJanuary 2022 deltaFebruary 2022 SalesFebruary 2022 delta
1Joe30005000200050002000
2Imran20008000600070005000
3Natalie6000900030003000-3000

 

Thanks in advance.

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous,

 

Try this calculated column:

 

Monthly Delta = 
VAR vDec2021 =
    CALCULATE (
        SUM ( Table1[Sales] ),
        ALLEXCEPT ( Table1, Table1[ID] ),
        Table1[Month] = DATE ( 2021, 12, 1 )
    )
VAR vSales = Table1[Sales]
VAR vResult = vSales - vDec2021
RETURN
    vResult

 

I converted the Month column to a date (first day of month; m/d/yyyy format).

 

DataInsights_0-1646058849633.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@Anonymous,

 

Try this calculated column:

 

Monthly Delta = 
VAR vDec2021 =
    CALCULATE (
        SUM ( Table1[Sales] ),
        ALLEXCEPT ( Table1, Table1[ID] ),
        Table1[Month] = DATE ( 2021, 12, 1 )
    )
VAR vSales = Table1[Sales]
VAR vResult = vSales - vDec2021
RETURN
    vResult

 

I converted the Month column to a date (first day of month; m/d/yyyy format).

 

DataInsights_0-1646058849633.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.