Forum Discussion
shuhn1229
1 year agoResolver I
Optimizing DAX Logic
Hi all, I am working with a large semantic model with about 10M records. The data quality is not the best. My data model involves cars and car parts (imaginary). The grain for my fact table i...
- 1 year ago
If the fallback logic (SelectedType when SelectedCategory is blank) is static, consider adding a calculated column in the fact table. This will avoid runtime computation:
PreferredCategory =
IF (
ISBLANK('Total Inventory'[Hoods]),
RELATED(Cars[Hoods]),
'Total Inventory'[Hoods]
)Then, in your measure, directly reference this column instead of recalculating it:
Optimized Measure with Column =
VAR SelectedAnalysisType = SELECTEDVALUE('Total Inventory'[Type])
RETURN
IF (
SelectedAnalysisType = "Pontiac",
SELECTEDVALUE('Total Inventory'[PreferredCategory]),
BLANK()
)π If this helped, a Kudos π or Solution mark would be great! π
Cheers,
Kedar
Connect on LinkedIn
shuhn1229
1 year agoResolver I
Want to mention I tried using GPT for this with limited success and I cannot get the COALESCE function working well with this for some reason.