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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Deviation Formula - Dax year wise

i have three 4 years data in my table . actuals values for  following 4 years 
2019,2020,2021,2022 

              2019        2020     2021    2022

Jan                         100       345     567

Feb                         200       564     345

Mar                        300       645      678

Apr                         400       234      456

May                        500       656      787

June    200              600       867      443  

July      300             700       345      566

 

i am using actuals value for the above graph . i am trying to find  deviation year  wise like 2020 -2021 and 2021 -2022

 

i am using below measure but i am not getting correct value 

 

2020 vs 2021 Measure = CALCULATE(SUM('Current Forecast'[Actuals])-SUM('Current Forecast'[Actuals])/calculate(SUM('Current Forecast'[Actuals]))).
 
 
any idea . thanks in advance.
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Unpivot this data have year on rows

https://radacad.com/pivot-and-unpivot-with-power-bi

 

then try measure like these and take diff

 

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Year'),'Year'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Year'),'Date'[Year]=max('Date'[Year])-1))

 

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

 

 

 

Have year table

year = distinct(Table[year])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Anonymous , Unpivot this data have year on rows

https://radacad.com/pivot-and-unpivot-with-power-bi

 

then try measure like these and take diff

 

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Year'),'Year'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Year'),'Date'[Year]=max('Date'[Year])-1))

 

diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

 

 

 

Have year table

year = distinct(Table[year])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  thank you . its working .is there any possible to hidden column header in table ?

@Anonymous , I did not get this

is there any possible to hidden column header in table ?

 

If you trying to hide a column in visual, I doubt that

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak   i am trying hide column header name in table . it is possible hide column header name ?

@Anonymous , I doubt an option hide column header, What I have done is past is font color same as the background

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
VahidDM
Super User
Super User

Hi @Anonymous 

 

Can you post sample data as text and expected output?
Not enough information to go on;

please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
4. Relation between your tables

Appreciate your Kudos!!
LinkedIn:www.linkedin.com/in/vahid-dm/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.