Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext 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
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?
Solved! Go to Solution.
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")
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")
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])
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 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."
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |