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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.