Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.