Forum Discussion

jakemorris606's avatar
jakemorris606
Frequent Visitor
4 years ago
Solved

Filtering Visual with DAX

Hello,

 

i have create a dashboard to show which contractors are on site daily - the table at the bottom is a filtered by a DAX function which returns the value 1 if the contractos fall within with the range today (TODAY()) so which morning when its refreshed the table is updated the contractors in today! - this works perfectly . 

 

however i want to use the same prinipcals for visuals  (PieCharts / Synopic Panels etc) but when use this same DAX in the filter it returns all the values as '0' - and no data is vailable unless i set the filter to is = 0 then it show all data in the entire data set.

 

my  DAX ;

 

Is displayed =
var _date = TODAY()
var _startdate = SELECTEDVALUE('Contractor Jobs'[Arrival Date])
var _enddate = SELECTEDVALUE('Contractor Jobs'[Last Day Of Attendance])
return
IF(_date>=_startdate&&_date<=_enddate,
1, 0
)
 
 
 

 

if anyone could offer any support i would be very greatful ,

 

 
kind regards,
jake 
  • jakemorris606 , Try a measure like

     

    countrows(filter('Contractor Jobs', 'Contractor Jobs'[Arrival Date] <= Today() && 'Contractor Jobs'[Last Day Of Attendance] >= Today()))

2 Replies

  • jakemorris606 , Try a measure like

     

    countrows(filter('Contractor Jobs', 'Contractor Jobs'[Arrival Date] <= Today() && 'Contractor Jobs'[Last Day Of Attendance] >= Today()))