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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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))

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))

amitchandak
Super User
Super User

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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