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
PGAT
Helper III
Helper III

Show stats from X day or month

Hi, I have data YTD on a chart.  At present, charts show the data by its months.  I will filter the months that have passed through visual filter.  Is there an auto way for the charts to show say, from current month less month? i.e.  June is current month, and i want stats to show from May 2020 onwards. 

 

Many thanks,

Patrick

3 REPLIES 3
amitchandak
Super User
Super User

@PGAT , month very clear to me ,

 

Assume you have Month Year

Month Year =Format([Date],"MMM-YYYY")

Create a new column like

Month Year New =if([Date] >=Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0) >= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

Sort it on

Month Year sort = FORMAT([Date],"yyyymm")

 

And Filter on Last Month, If need Last Month and This Month

Or have measure like

MTD QTY forced=
var _max = today()
var _min = minx(allselected('Date'),'Date'[Date])
return
calculate(Sum('order'[Qty]),filter(all('Date'),'Date'[Date]<=_max && 'Date'[Date]>=_min))

Hi there Amitchandak, thank you for taking time. I will try. 

Hi @PGAT ,

 

Does the amitchandak's answer make sense? If it works for you, please accept it as solution. If you still need help, please share some sample data and expected output. We will understand clearly.

 

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

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.