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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
kolturra
Helper IV
Helper IV

% Comparison from Pervious Year and Month Measure

Hi Experts,

 

I need a help with regards to % Comparison from Pervious Year and Month Measure and both should come from same visual using drill down option.

 

we can use any dummy data to achieve my graphs

 

Year Wise Presentation

kolturra_0-1622888305707.png

When i drill down i should view Month Wise View like below

kolturra_1-1622888524082.png

 

Thanks,
Raghu

 

 

 

3 REPLIES 3
Fowmy
Super User
Super User

@kolturra 

I am not sure if I read your question correctly. If you want to drill down to the next level, you click on the double arrow.

Fowmy_0-1622904707103.png
Make sure your fields are stacked as below:

Fowmy_1-1622904744541.png

 

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Sorry I think I did not give proper communication in my earlier message. We need to create measure for % comparison with previous year and month

Year wise Visual.

  1. Year wise it has values of each year in bar.
  2. % Comparison with previous year which is line chart - This we have to achieve with measure

Drill Down Visual - Once we click on specific year, we will drill down to Month level.

  1. Months wise it has values of each month in bar.
  2. % Comparison with previous month which is line chart - This we have to achieve with measure

 

 

My data is in below format

 

Column 1 - Month - Jan 2020 to Dec 2021

Column 2  - Value - between 100 to 200

 

Not able to paste table because of some error, if you create this table then my data will be ready

@kolturra 

I created the sample data based on your explanation for the years 2020 to 2022, add a date table to use Time Intelligence functions, created the following single measure to calculate % variance for both year and month level. I also attached the PBIX file for you to learn.

vs Previous Period  % = 
var __Curr = [Amount]
var __PreYR = 
    CALCULATE(
        [Amount],
         DATEADD( Dates[Date] , -1,YEAR)
    )
var __PreMO = 
     CALCULATE(
        [Amount],
        DATEADD( Dates[Date] , -1,MONTH)
    )

var result = 
    IF(  
        ISFILTERED(Dates[Year-Month]),
        DIVIDE( __Curr - __PreMO , __PreMO ),
        DIVIDE( __Curr - __PreYR , __PreYR )
    )
return
    result

 

Fowmy_1-1622909138088.png

Fowmy_2-1622909152022.png

 

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors