Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey,
I need some help with putting together a dax query.
1. What I need is Status column that returns either (Active/Inative), if the Comment Date field is between the start and end date of the selected Date filter. In the image below, I am currently receiving an 'Active' status, however, the intended status I expect to see 'Inactive' status.
2. The table should not filter out any suburbs that are not within the selected Date range.
Here is my current relationship:
Here is the current status dax query I am using
Status =
VAR firstselecteddate = FIRSTDATE('Calendar'[Date])
VAR lastselecteddate = LASTDATE('Calendar'[Date])
RETURN
If(
Table1[Comment Date] >= firstselecteddate || Table1[Comment Date] <= lastselecteddate , "Active", "Inactive"
)
Solved! Go to Solution.
Update: I have found what I needed to do via the following link:
https://radacad.com/power-bi-from-and-to-date-filtering-with-one-slicer
Thank you for your responses.
Update: I have found what I needed to do via the following link:
https://radacad.com/power-bi-from-and-to-date-filtering-with-one-slicer
Thank you for your responses.
Hi,
Share the download link of the PBI file.
Hey @Ashish_Mathur ,
Here is a copy of the PBI file: https://1drv.ms/u/s!AsNILaiR3etzhR5-qjmALmnh_nkg?e=J3NSzJ
Thanks for responding
I'm using a disconnected date table with the following measure:
Status =
VAR firstselecteddate = MIN( 'Calendar'[Date] )
VAR lastselecteddate = MAX( 'Calendar'[Date] )
VAR result =
IF(
SELECTEDVALUE( Table1[Comment Date] ) >= firstselecteddate
&& SELECTEDVALUE( Table1[Comment Date] ) <= lastselecteddate,
"Active",
"Inactive"
)
RETURN
result
https://1drv.ms/u/s!AnF6rI36HAVkhPIamxvEeIJyEPNBXw?e=fuawQP
HI @yussuf020 ,
try
Status =
VAR firstselecteddate = FIRSTDATE('Calendar'[Date])
VAR lastselecteddate = LASTDATE('Calendar'[Date])
RETURN
If(
Table1[Comment Date] >= firstselecteddate && Table1[Comment Date] <= lastselecteddate , "Active", "Inactive"
)
the && will give datesbetween selected values of first selected date and last selected date.
However, please note. the first date value = the Start/minimum date in the date table. it is not the selected value from the slicer.
if this doesn't work, kindly provide the action date as well in a copy-paste table format.
Appreciate a thumbs up if this helps.
Please accept this as the solution if your query is resolved.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
82 | |
74 | |
66 |
User | Count |
---|---|
120 | |
105 | |
99 | |
81 | |
72 |