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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
THENNA_41
Post Partisan
Post Partisan

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

@THENNA_41 , 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])

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@THENNA_41 , 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])

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

@THENNA_41 , 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

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

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

VahidDM
Super User
Super User

Hi @THENNA_41 

 

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
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.

Top Solution Authors