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
Nitin03
Frequent Visitor

Last N months from selected month and year

final.png

 

 

Hi experts need your help.
Indian financial year start from April and end on March. So what i need when I will select Fiscal Year 2018-19 in slicer and month of April then it should display previous fiscal year's 6 month i.e from Oct 2017-18 to march 2017-18 and April 2018-19 which will be total 7 months . So when I will take that final measure in slicer, It should filter all the visual on a page.
For your reference please find attached pbix file. PBIX File Link 
thanks in advance. 

 

1 ACCEPTED SOLUTION

Hi Nitin,

 

The pbix I shared with you is working exactly as you're describing it. I only see seven months of data at a time.

 

Below is what you see when Fiscal Year 2018-2019 and Month of April is selected. The data starts from October.

Wilson__2-1680962130322.png

 

Below is what you see when Fiscal Year 2018-2019 and Month of May is selected. The data starts from November.

Wilson__3-1680962156543.png

Please double check that you applied my steps to your file correctly. 😄 For example, the least straight forward step in my solution was using the duplicated table in both the fiscal year and month slicers, but the original table in the visual itself.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

View solution in original post

3 REPLIES 3
Wilson_
Memorable Member
Memorable Member

Hello Nitin,

 

I've downloaded your pbix, added my solution to it and re-uploaded your pbix here.

 

What I've done is the following:

 

  • Added a Month Year (and Month Year Sort) column to match the labels in your visual
  • Duplicated your Date table to use as the date slicer, while using your original Date table in the visual itself
    • This step was important in my particular solution so I could use the field in the slicer, while also preventing it from filtering the Sales table. (Note: I had to re-apply your column sorts in the duplicated table.)
  • Created a Sales Amount measure, and a corresponding Display Sales Amount measure that applied your stated logic.
    • In essence, I used variables to calculate the window for which I would want to show the total sales, then showed the Sales Amount measure if the Month Year fell within that range.

Please let me know if you were looking for something different or please confirm if my solution is what you were looking for! 😄

Thank you Wilson for your help!  I have download the file that you uploaded and follow the all the steps  that you have mention, in my current data. But the  data is not filtering. When i select fiscal year and month in slicer from Datefilter table It show all the months from Apr to March and Apr(current year) values also get added in previous year Apr. My 50% problem get solved, just there is filter issue should resloved. I request you for futher help i.e. when I will select Fiscal Year 2018-19 in slicer and month of April then it should display previous fiscal year's 6 month i.e from Oct 2017-18 to march 2017-18 and April 2018-19 which will be total 7 months Also when i will select next month i.e May then Nov 2017-18 to Apr-2018-19 shold also display. This should appply all the next moths. Hope you undestand the problem, If not pls let me know. 

Hi Nitin,

 

The pbix I shared with you is working exactly as you're describing it. I only see seven months of data at a time.

 

Below is what you see when Fiscal Year 2018-2019 and Month of April is selected. The data starts from October.

Wilson__2-1680962130322.png

 

Below is what you see when Fiscal Year 2018-2019 and Month of May is selected. The data starts from November.

Wilson__3-1680962156543.png

Please double check that you applied my steps to your file correctly. 😄 For example, the least straight forward step in my solution was using the duplicated table in both the fiscal year and month slicers, but the original table in the visual itself.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

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