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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ppvinsights
Helper III
Helper III

Measure Caching in tables and circular dependency

Hi community,

 

in a current report I have performance problems - I always receive a timeout in the service. Because I cannot find a better way to calculate my measures, I thought about introducing a cache table: I take my dimensions in a CROSSJOIN statement, surround it by ADDCOLUMNS and let my measure/s be caculated for every row in a new "cache table".

 

I would love to still work with my original dimensions. But I cannot connect my dimension-columns of my "cache table" with any dimension - because I would introduce a circular dependency. Is there any best practise to solve that?

 

Thanks

Holger

 

1 ACCEPTED SOLUTION

Found it myself... The RAW Filter introduces "All" - and with using ALL I introduce the Blank row of the dimension. **bleep**. Obvious...

 

 

View solution in original post

3 REPLIES 3
ppvinsights
Helper III
Helper III

I just tried to build an easy example with Testdata. And, yes, sure: everything worked. So it took me a while to find a difference:

 

I have a Table called "Person". I have another table called "Order". And I have a calendar table. I have a measure "OrderValue=sum(Order[TotalDue])" - nothing special.

Now I build my "cache table" - I want to precalculate "total due per person per year):

Cache table =
ADDCOLUMNS(
    CROSSJOIN(
        DISTINCT(DimKalender[Jahr]),
        DimPerson
    ),
    "value", [OrderValue]
)

 

When I try to create a relation 'Cache Table'[BusinessEntityID] - 'DimPerson'[BusinessEntityID] everything works fine.

 

Now I change the DAX-statement a little bit - because I only want to see customers called "Yang":

 

Cache table = 
var c = CALCULATETABLE(DimPerson, FILTER(DimPerson,DimPerson[LastName] = "Yang"))
return
ADDCOLUMNS(
    CROSSJOIN(
        DISTINCT(DimKalender[Jahr]),
        c
    ),
    "value", [OrderValue]
)

==> Everything still works fine.

 

So I found another difference between my implementation and my example: I used a RAW Filter:

 

Cache table = 
var c = CALCULATETABLE(DimPerson, DimPerson[LastName] = "Yang")
return
ADDCOLUMNS(
    CROSSJOIN(
        DISTINCT(DimKalender[Jahr]),
        c
    ),
    "value", [OrderValue]
)

 

And now I have a circular dependency between my cache table and DimPerson.

 

Can anyone explain that for me...?

Found it myself... The RAW Filter introduces "All" - and with using ALL I introduce the Blank row of the dimension. **bleep**. Obvious...

 

 

some_bih
Community Champion
Community Champion

Hi @ppvinsights 

please share example / file of data as input for expected output.





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

Proud to be a Super User!






Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.