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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to dynamic show the current date , then use the current date to get actual target pipeline

Hello All, I couldn't figure out a few questions. Will be very appreciate if you can provide some insights. I have an extract dataset.  this a mock data, no rules to follow. the real data has 12 KPI's , each has actual , target, pipeline value,  here I only show 1 KPI.

challenge I am facing is , this is a extract file, the current date is 1/1/2020, the latest date will change when new extract version come in, so I dont want to use filter.

I want to show:

1, a dynamic way to show the latest date that has actual value, in this case will be 1/1/2020, maybe in the future, the extract file will show another different date. I don't want to use filter manually.

2, a dynamic way to show the actual value , target , pipeline that related to this date, in this case is 1/1/2020.

3, a dynamic way to show last month or same month from last year value that related to the current date, in this case it is 1/1/2020

4, a way to show cumulative value from current value, last month, or the same month from last year.

Sorry for lots of questions. I am new for POWER BI, looking forward to learn more from this community

DATEACTUAL 1ACTUAL 2TARGET 1PIPE LINE 1
1/1/201997747.91234.49666.310311.5
2/1/2019107757.21111.310110.710671.5
3/1/201997747.92113.510555.111031.5
4/1/201937692.11555.210999.511391.5
5/1/201947701.41994.755666.79591.5
6/1/201957710.72191.216111.19951.5
7/1/201947701.42387.676555.55271.5
8/1/201933688.382584.135222.35631.5
9/1/201925680.942780.595666.75991.5
10/1/201917673.52977.056111.16351.5
11/1/20199666.063173.516555.56711.5
12/1/20191658.623369.976999.97071.5
1/1/20206348.823566.437444.37431.5
2/1/20200 5188.115387791.5
3/1/20200 4856.036264555.8
4/1/20200 4523.957144399.3
5/1/20200 4191.878024228.1
6/1/20200 3859.79892532
7/1/20200 3527.719781447.33
8/1/20200 3195.64066362.66
9/1/20200 2863.561543200
10/1/20200 2531.482423200
11/1/20200 2199.40332400
12/1/20200 1867.324182000
1 ACCEPTED SOLUTION

Check this.

https://www.dropbox.com/s/cml0oawqxrs12ma/dynamicCurrentDate.pbix?dl=0

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

When you want default date, you use relative date slicer or these option s

https://community.powerbi.com/t5/Desktop/Set-TODAY-as-default-date-in-slicer-visual/td-p/488670

https://www.youtube.com/watch?v=lkHFpmA4SJ4

Also, you can create a column flag of today and filter on that.

Flag = if(date[date] =today(),"Yes","No")

Have a date dimesnion table and join it with date. Post that you can use time intelligence functions.

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))

MTD (Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR('Date'[Date])))
MTD (Last Year End) Sales =  CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFYEAR(dateadd('Date'[Date],-12,MONTH),"8/31")))
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-3,MONTH)) 

Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-12,MONTH))  
3 month back MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-3,MONTH)))
 


QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))

Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))
Next QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],1,QUARTER)))

Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))





YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
2 Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-2,Year))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM('Fact table'[Sales]),filter(date,date[date] <=maxx(date,date[date]) 
	&& weekday(sales[date]) <=weekday(maxx(date,date[date])) ))

Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-2,Year)),"12/31"))
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))  
Rolling last 12 before 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd('Date'[Date],-12,MONTH)),-12,MONTH))  
Rolling last 1 before 1 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],Maxx('Date',dateadd('Date'[Date],-1,MONTH)),-1,MONTH))  
	Rolling 1 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],max(Sales[Sales Date]),-1,MONTH))  

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s.

Refer
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi

https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Hi, thanks for the detail reply.

About the date, I did not want to get today's date, the latest date in data is 1/1/2020, not 2/6/2020. that is the date I need to get.

Once I have that date,I assume I could get the actual , target and pipeline value for that same date. I prefer to not use slice or filter, is there a way to have formula to get 1/1/2020 , and actual value? thank you

This is what you can try when you create you calendar. create it till max date of your fact.

 

Date = Calendar(minx(sale,sales[sale date]),maxx(sale,sales[sale date]))

 

This will stop last date at the last transaction and all-time intelligence functions should work from that date. As we are passing  Date[Date] to those.

 

Hope this will help

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  thank you Amit. I tried, it is not working. these information are in one table. meaning the actual and target share one date. If I use calendar, the max date still is 12/1/2020, not 1/1/2020. Is there a way to use filter and this formula? thanks again

Check this.

https://www.dropbox.com/s/cml0oawqxrs12ma/dynamicCurrentDate.pbix?dl=0

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Thank you so much !!! 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors