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
ignas
Advocate II
Advocate II

Display the last 12 months data based on Slicer selection

 

Hello

I have one simple issue. Based on selected month in Slicer I need to have the last 12 months displayed in the graph:

Capture.JPG

I need both Year and Date Slicer. If I select Date Slicer then I get only that month data. How could I display the last 12 months?

 

Here is the dashboard:
https://mega.nz/#!uzglxJQa!cqyaSpTT6dINqn65MP-oolW2jjRDNs15AAAAAAAAAAA

 

Regards,

Ignas

4 REPLIES 4
Greg_Deckler
Super User
Super User

You will need a disconnected Date table for your slicer so that it does not impact your visual. You would then grab the MAX of that and then you could build a measure for your visual that only returns a value if it is within the last twelve months based upon that MAX.


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

This is exactly what I am looking for but I am not certain I understand your solution. Could you unpack that a little?

I have a Date table.

Are we saying I should have a second separate date tabel that doesn't have a relationship with the fact table? 

How would I grab the MAX of that? Do you mean a measure that's something like:

MaxDate = MAX(Datetable[Date])

What would that measure look like that only returns a value if it is within the last twelve months based on the MAX?

 

Thank you!

 

Best regards,

~Don

DebbieE
Community Champion
Community Champion

Im really struggling with this at the moment and need to apply this a a fair few visuals. Surely there is a simpler way of doing this?  Im struggling to understand both of these solutions.

 

Currently All I can do is crete a rolling 12 months based on the current date and go from there but the fact its not attached to the filter is not great.

 

Im using a hierarchy slicer so I drill down 2019 March and I want my visul to show This month and the last 12. I already have a column in my date dim with 'Mar 2019' 'Feb 2019' etc that I thought I could use in the visual

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.