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

Current, Past and Past 2 Month in PBI

Hello, 

I try to create a PBi that can show data for :
- the current month (This one is working)
- the past month : 
I want to show bunch of data like school grades, for example, for the past month (that can change automatically month by month). For the moment I select the past month in the filter section but I would like to know if there is a way for the date to change automatically month by month (for example, today the past month is September because we are in October. But I know that when we will be in November the filter will stay on September instead of October). 

- the month 2 times back (example, we are in September so I need to see datas for the month of August only)

I already search on Microsoft Doc and I don't manage to found something helpful for my case.. 

I hope someone can help me. 

 

Regards,

 

Luca

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

Hi @Luca_Luca ,

 

Create a measure via this code:

last 1 moth = 
var _start= DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)
var _end = EOMONTH(TODAY(),-1)
return
IF(SELECTEDVALUE('Table'[Date])>=_start&&SELECTEDVALUE('Table'[Date])<=_end,1)

 

And put it in the filter pane of this visual, set it shows items which is 1

vchenwuzmsft_0-1665121943644.gif

 

Best Regards

Community Support Team _ chenwu zhu

 

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

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @Luca_Luca ,

 

Create a measure via this code:

last 1 moth = 
var _start= DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)
var _end = EOMONTH(TODAY(),-1)
return
IF(SELECTEDVALUE('Table'[Date])>=_start&&SELECTEDVALUE('Table'[Date])<=_end,1)

 

And put it in the filter pane of this visual, set it shows items which is 1

vchenwuzmsft_0-1665121943644.gif

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello chenwu zhu,

Thank you so much ! 

 

Best Regards

Luca

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.