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
sreddy47652
Helper II
Helper II

Current vs Previous year to show in matrix

Hi Team, I need some help to display current vs previous year for each category. For example i have data on below each category wise many years of data irrespectively i want to show only current and last year for each certification. Please find the below screenshot.

sreddy47652_0-1651652631407.png

 

1 ACCEPTED SOLUTION

@v-cgao-msft please find the below url for sample data.https://docs.google.com/spreadsheets/d/1FJWoNldusCiTt-e3Qb9Nun1kO9b6-OKw/edit?usp=sharing&ouid=10835...

i want to display copleted values of current and previous year comparison.

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@sreddy47652 , You can add 2 measures

 

//Only year vs Year, not a level below

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

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

@amitchandak Thanks for your reply, how ever i am trying the samethng but it's not working for me. as we don't have any date table and all columns are coming from same table. while using date column on same table it's not getting proper values.

Hi @sreddy47652 ,

 

You can create a calendar table and then create a relationship with the date column of the original table.

 

Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

If this doesn't work for you, would you mind providing some data that does not contain private information?

It makes it easier to give you a solution.

  1. Sample (dummy dataset) 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.

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

 

@v-cgao-msft please find the below url for sample data.https://docs.google.com/spreadsheets/d/1FJWoNldusCiTt-e3Qb9Nun1kO9b6-OKw/edit?usp=sharing&ouid=10835...

i want to display copleted values of current and previous year comparison.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.