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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Date Parameter as Tableau

Hello Team,

 

I have two date parameters 1. Start Date and 2. End date, both are dates and need to be used in the below formula to get counts. I have created a date table as below but i can't use them in my formula. please suggest.

 

Formual -:   Planned Counts FY = IF(VW_FI_FREC_InvCount[Planned Count Date] >= VW_FI_FREC_InvCount[StartDate] && VW_FI_FREC_InvCount[Planned Count Date] <= VW_FI_FREC_InvCount[EndDate] ,
IF(YEAR(VW_FI_FREC_InvCount[Planned Count Date]) = YEAR(VW_FI_FREC_InvCount[EndDate]) && YEAR(VW_FI_FREC_InvCount[Planned Count Date]) = YEAR(VW_FI_FREC_InvCount[EndDate]), 1, 0))
 
 
Date Table formula = 
Start Date = CALENDAR("01/01/2015", TODAY())   
 
Thanks.
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , this how you can use two dates selected in slicer

Measure =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = minx(allselected('Date'),'Date'[Date])
return
calculate(count(Table[value]),filter(All(Table),Table[date] <=_max && Table[account creation date] >=_min))

 

Measure =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = minx(allselected('Date'),'Date'[Date])
return
calculate(count(Table[value]),filter(Allselected(Table),Table[date] <=_max && Table[date] >=_min))

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

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , this how you can use two dates selected in slicer

Measure =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = minx(allselected('Date'),'Date'[Date])
return
calculate(count(Table[value]),filter(All(Table),Table[date] <=_max && Table[account creation date] >=_min))

 

Measure =
var _max = maxx(allselected('Date'),'Date'[Date])
var _min = minx(allselected('Date'),'Date'[Date])
return
calculate(count(Table[value]),filter(Allselected(Table),Table[date] <=_max && Table[date] >=_min))

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
amitchandak
Super User
Super User

@Anonymous , refer if this blog can help you how to deal with two dates

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

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  Thanks but my data source does not have start and end date, it just custom date range to be used as a reference in the filter to filter certain period  by the user. 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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