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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Formula em Direct Query

Can I use in a direct query a formula as a date filter (date is returned by a dax formula?

4 REPLIES 4
PijushRoy
Super User
Super User

Is it possible to share sample data and your expected result.




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





PijushRoy
Super User
Super User

What is the usae of date filter? 
Date filter DAX for measure?




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Anonymous
Not applicable

I tried to use the formula below:

AntStock502W_Branch1 =

CALCULATE(

    SUMX('Stock_Diary_502_Branch_1',[ESTOQUE_DIARIO_502_1] ),

    FILTER( 'Estoque_Diario_502_Filial_1', [DATA] = [DataEstoqAnt502_Filial1])) where DataEstoqAnt402_Filial1 is a dax formula that returns the last date that had movement. , but the formula is returning the wrong value.

In principal what you're trying to do is fine. I suspect the reason you're getting wrong values is that your measure

is being evaluated in the context of each row in your filter table (measures force a

context transition.) Depending on what result you're trying to achieve you want to read the value into a variable earlier on to fix it. As @PijushRoy suggests can you share a sanitised pbix file?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.