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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Month by Month filtering where previous years total remains the same

Hi there, 

 

I'm very new to Power BI. I am looking for the best way to filter monthly figures for the current year of my dataset (2018) against a summation of all years previous. I have over 10 years worth of data, and would like to isolate this year's monthly figures against the summation of all figures prior to be enable drilldown for my visuals on the dashboard. 

 

From the sample data below, the columns I am using are Employee Number and Start Date. 

 

BGEmployee NumberService LineFunctionDepartmentAgeGenderWork LocationJobGradeLength Of ServiceStart Date
UK123   25     01/02/1999
UK1234   57     02/03/2000
UK12345   45     04/05/2000
UK123456   65     10/12/2001
UK1234567   23     25/02/2003
UK1234567   45     04/07/2003
UK1234567   45     08/09/2003
UK1234567   65     01/02/2004
UK1234567   23     05/06/2006
UK1234567   34     08/10/2006
UK1234567   35     01/05/2007
UK1234567   36     01/08/2008
UK1234567   44     06/08/2009
UK1234567   55     07/08/2010
UK1234567   57     06/07/2012
UK1234567   22     06/09/2015
UK1234567   45     01/01/2018
UK1234567   61     03/04/2018
UK1234567   21     05/06/2018

 

 From this, I would like to display the total number of employees on my dashboard. I would like to use a month by month filter to show month changes of 2018 against all years previous. 

 

In more detail, i would like to be able to filter say the figures for January 2018, these figures would be added to the total figures for all years prior.  Or for February and March 2018, which would exclude January and the subsequent months for 2018 against the total figures for all years prior. 

 

Here's the relationship pane for the dataset: BI relationship.PNG

 

Is this something that can be done?

 

Thanks in advance!

 

7 REPLIES 7
v-yuta-msft
Community Support
Community Support

Hi alby,

 

"In more detail, i would like to be able to filter say the figures for January 2018, these figures would be added to the total figures for all years prior. Or for February and March 2018, which would exclude January and the subsequent months for 2018 against the total figures for all years prior. "

 

<--- Could you give some expected results and share more details about the logic of how to achieve the total amount all previous year? Do you have some filter condition like based on some slicers?


Regards,

Jimmy Tao

Anonymous
Not applicable

Hi,

 

I have a list of 5 State Financial years ranging from 2013 to 2018. I am able to calculate difference between two consecutive years(2017,2018) and difference between current year 2018 with any previous year but not able to calculate difference for previous years like (2015,2017)

The DAX functions I used here are:

YTD= Total YTD([Value], (Date), “2018/6/30”)
PYTD = Calculate([YTD], Datesbetween(Date), Date(2013,7,1), Date(2017,6,30)))

Can someone assist me here? Thanks!

See if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks for the reply. I did try that but somehow it did not work for my dataset or maybe I did not do it correctly, Can you please let me know if my DAX formulas are correct?

 

YTD= Total YTD([Value], (Date column), “2018/6/30”)
PYTD = Calculate([YTD], Datesbetween(Date column), Date(2013,7,1), Date(2017,6,30)))

Hi rohitvungarala,

 

Have you solved your issue? If you have, could you kindly mark my answer?

 

Regards,

Jimmy Tao

Hi rohitvungarala,

 

To compare values between 2018 and 2015, you should achieve total value in 2015 and 2018 separately,  you can modify your formula like below and check if it can meet your requirement. 

 

Value in 2015 = Calculate([YTD], Datesbetween(Date column), Date(2014, 6, 31), Date(2015, 6, 30)))

 

Regards,

Jimmy Tao

Greg_Deckler
Super User
Super User

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


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.