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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Can you build date parameters to use in formulas like Tableau?

I have several different calcualtions that need to use the same adjustable start and stop dates. Can I build two date parameters to use to define my calculations in such a way that all the users need to do is change the dates and it will populate the table? This was straight forward in Tableau but still working out the DAX translations. 

 

The calculations/formulas are something to the effect of:

Applied date <= end date

NOT ISBLANK(approved date)

service date >= start date && service date <= end date

 

Alternatively, will DAX want three seperate filters, one for applied date, one for approved date, and a third for service date?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I found the easiest solution solution was to create two date formulas with the precise dates. Then use them in a custom column to filter out the counts I wanted. However, this requires the creator to change the dates rather than allowing the viewers to adjust the dates themselves. Is there a way to create a formula/parameter/field that viewers can adjust themselves?

e.g. start date = DATE(05/01/2022).
       end date - DATE( 05/01/2023)

Active in Year = SWITCH( TRUE( ),
NOT( ISBLANK ('table'[service closed date])) && 'table'[service closed date] >= [start date] &&
'table'[applied date] <= [end date], "closed but served this year",
ISBLANK([service closed date]) && 'table'[applied date] <= [end date], "still active, served this year",
"not served this year")


View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I found the easiest solution solution was to create two date formulas with the precise dates. Then use them in a custom column to filter out the counts I wanted. However, this requires the creator to change the dates rather than allowing the viewers to adjust the dates themselves. Is there a way to create a formula/parameter/field that viewers can adjust themselves?

e.g. start date = DATE(05/01/2022).
       end date - DATE( 05/01/2023)

Active in Year = SWITCH( TRUE( ),
NOT( ISBLANK ('table'[service closed date])) && 'table'[service closed date] >= [start date] &&
'table'[applied date] <= [end date], "closed but served this year",
ISBLANK([service closed date]) && 'table'[applied date] <= [end date], "still active, served this year",
"not served this year")


Anonymous
Not applicable

Hi  @Anonymous ,

 

If you want to filter a specified date using a filter of three dates, I suggest that you create three unrelated date tables, so that when filtering, they are all independent and will not affect the filters of other date tables

Measure =
var _applied=SELECTEDVALUE('Applied date'[Date])
var _approved=SELECTEDVALUE('approved date'[Date])
var _service=SELECTEDVALUE('service date'[Date])
return
COUNTX(
    FILTER(ALL('Table'),
    _applied <='Table'[end date] &&
    _approved <> BLANK() &&
    _service>='Table'[start date]&&_service<='Table'[end date]),[ID])

vyangliumsft_0-1682399601603.png

 

Best Regards,

Liu Yang

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

Anonymous
Not applicable

@Anonymous   I missed a criteria, I need a hasn't closed or closed after the start date so I tried to use:

ISBLANK(_closed) ||
_closed >= 'table'[start date]

 

after I created a "var _closed = SELECTEDVALUE( 'table'[date closed])" but now it gives me the error message "Too many arguments were passed to the FILTER funciton. The maximum argument count for the function is 2."

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.