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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

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?

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

When using Direct Query, filtering is based on your slicers even if you use ALL. This function (and related ones) do still work to remove the filter context within a visual.

 

See this related thread:
https://community.powerbi.com/t5/Desktop/All-Function-Ignored-When-Using-Power-BI-in-Direct-Query-Mo...

 

 

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

When using Direct Query, filtering is based on your slicers even if you use ALL. This function (and related ones) do still work to remove the filter context within a visual.

 

See this related thread:
https://community.powerbi.com/t5/Desktop/All-Function-Ignored-When-Using-Power-BI-in-Direct-Query-Mo...

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors