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

Trend based on slicer selection

Hey guys,

 

I'm trying to create a line chart that shows the data for the past few months based on the date I choose via slicer. Anyone know how I could achieve this? Thanks.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at the following post.

https://community.powerbi.com/t5/Desktop/Report-on-Current-Calendar-Month-Excluding-Today/m-p/346431#M155473

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may take a look at the following post.

https://community.powerbi.com/t5/Desktop/Report-on-Current-Calendar-Month-Excluding-Today/m-p/346431#M155473

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Anonymous
Not applicable

No what I meant was that I want the user to be able to select a certain week or month, and then the visual show data for that ranging from the selected month/week back to however many months back I select. i.e They select december (assume a year selection is made form another slicer) and see data from October-December. If they select June they see data from April-June.

 

@Anonymous

@Anonymous,

You need to create independent table as below

Chakravarthy_0-1711906410475.png

Create a measure:

3M TREND =
VAR _MAX = MAX(Date_Independent[Date])
VAR _MIN = EOMONTH(_MAX,-3)+1
VAR _FILTER = FILTER('Date','Date'[Date]>=_MIN && 'Date'[Date]<=_MAX)
VAR _RESULT = CALCULATE(SUM(Region[Sales]),_FILTER)
RETURN _RESULT
 
Chakravarthy_1-1711906743055.png

 

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.