Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Direct Query ALL() and ALLSELECTED() Limitations?

Hello, 

 

My DAX formulas containing ALL() and ALLSELECTED() do not seem to be working as advertised within the context of a Direct Query Connection. 

 

Query TimeFrame Seconds = 
VAR Start_time = 
CALCULATE( 
       MIN(Detections[DetectionDateTime])
      ,ALL(Detections)
                )

VAR End_time = 
CALCULATE( 
       MAX(Detections[DetectionDateTime])
      ,ALL(Detections)
                )

RETURN DATEDIFF( Start_time, End_time, SECOND )

 

A similar query using the ALL() function in this same context. but using an import data method (pointing to existing dataset in PBI Service) , is working as expected. When I choose a specific device within a slicer viz on the report page canvas, The card viz displaying number of seconds between the min and max timestamp for all devices, does not change when 1 device is selected, which is what I am going for. 

 

Is this possible using Direct Query? Is there another way I can produce static time ranges using my min and max calculations?