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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
champioz
Frequent Visitor

Slow calculated column is made faster with a calculated table -- but need to find alternative option

 

 

I have a somewhat complex issue:

-LiveQuery dataset that is too large to import, so since I need a scheduled refresh calculated tables not really an option

-Given a list of ID -> category mappings for one of the dimension tables to define a calculated column for use in filtering. First implemented it as a big ugly switch statement based on substrings of the ID. Even with some logic cleaning as seen here I'm getting 30+ seconds to slice using the calc columm directly.

-Out of curiosity tried a calculated table to reduce the search space to just the subset of IDs that are getting mapped to a category. After giving it the necessary relationships, using the calculated table's copy of the calculated column to slice the ORIGINAL table is extremely fast and snappy. But as mentioned this is not a viable solution due to refresh. I'm not getting the same results when I reduce the search space instead via either a second, preliminary calculated column or properly ordering the logic in the main column to wipe out the irrelevant IDs first.

 

Why is this happening, and is there a way to get this sort of performance without the need for a calculated table? Logic below for illustration.

 

-------

Scenario: first, filter to parts that contain d_. Then, this subset has multiple categories based on substring. Doing this all in one calculated column is unusably slow, separating the first step into a calculated table makes it very fast.

 

The two original tables, the ID dimensional table and some fact table:

champioz_0-1717173843213.png     champioz_1-1717173859247.png

 

The Calculated column formulae:

champioz_2-1717173902029.png   champioz_3-1717173917383.png

 

The Calculated Table with formula:

champioz_4-1717173949583.png

 

And the implementation/results -- the table visual here is populated with the original dimension table and the fact table(s):

champioz_5-1717174051646.png

 

Any insights are appreciated!!!

 

2 REPLIES 2
lbendlin
Super User
Super User

LiveQuery dataset that is too large to import, 

Have you considered partitions and/or incremental refresh?

That's a good idea -- I'll have to talk to our data engineer but that would be much preferable to hacking together something that works with limited calculations.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.