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
TimmK
Helper IV
Helper IV

Slow Performance

I follow the star schema having the DIM tables "Item" and "Supplier", as well as the FACT table "Price".

 

These are the measures I use:

Measure 1 = 

CALCULATE(MAX('Price'[Start Date]),FILTER('Price','Price'[Start Date]<>MAX('Price'[Start Date])))

 

Measure 2 = 

VAR SL_ = [Measure 1]
RETURN
CALCULATE(SUM('Price'[Price]),'Price'[Start Date]=SL_)

 

With measure 1 I determine the second to last date. With measure 2 I use measure 1 to determine the price existing on the second to last date.

 

Generally it works, but the performance of the table is very slow.

 

In contrast, when I merge "Item" and "Supplier" with the "Price" table, thus having one large table with everything, the performance is fast. However, then I lose the benefits of the star schema.

 

Why is the performance to slow under the star schema and how can I make it fast?

 

The report table uses "Item" table (colums article number, article description), the "Supplier" table (column supplier name) and the "Price" table (columns unit, minimum quantity) as well as the mentioned measures.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@TimmK , Try with these changes

 

Measure 1 =

CALCULATE(MAX('Price'[Start Date]),FILTER('Price','Price'[Start Date]< MAX('Price'[Start Date])))

 

Measure 2 =
VAR SL_ = [Measure 1]
RETURN
CALCULATE(SUM('Price'[Price]),filter('Price', 'Price'[Start Date]=SL_))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@TimmK , Try with these changes

 

Measure 1 =

CALCULATE(MAX('Price'[Start Date]),FILTER('Price','Price'[Start Date]< MAX('Price'[Start Date])))

 

Measure 2 =
VAR SL_ = [Measure 1]
RETURN
CALCULATE(SUM('Price'[Price]),filter('Price', 'Price'[Start Date]=SL_))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.