cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
mtb1973
Frequent Visitor

Dax Query Slow - Need ideas to Optimize

Hello,

I am afraid I can't add a whole lot in the way of PBIX/Sample Data due to the fact that I love my job and don't want to get fired.
With that being said, does anyone have a potential better way to write the following? It, unfortunately is very slow.

 

Thanks

 


CALCULATE(
SUMX(
SUMMARIZE(
Dim_Date,
Dim_Date[FullDate],
"Budgets", [ShipDaysBudgetAllocation]
),
[Budgets]
),
FILTER(
ALLSELECTED( Dim_Date ),
Dim_Date[FullDate]
<= MAX( Dim_Date[FullDate] )
)
)

2 REPLIES 2
AlexisOlson
Super User
Super User

Is it necessary to iterate through each date independently for [ShipDaysBudgetAllocation] to work properly? How is that measure defined?

 

Unrelatedly, try this refactoring:

VAR SelectedDays =
    CALCULATETABLE (
        VALUES ( Dim_Date[FullDate] ),
        ALLSELECTED ( Dim_Date ),
        Dim_Date[FullDate] <= MAX ( Dim_Date[FullDate] )
    )
RETURN
    SUMX ( SelectedDays, [ShipDaysBudgetAllocation] )

 

smpa01
Super User
Super User

@mtb1973  can you provide a bit of context to this

and how [ShipDaysBudgetAllocation] is made of?

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






New Animated Dashboard: Sales Calendar


Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors