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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors