I encountered a situation that the WHERE clause in a SQL query changes based a parameter. When the parameter is '_All', there is no restriction. When the parameter is any other value, an AND section in the WHERE clause is needed.
After some digging, I found an elegant solution. Using
(@parameter = '_All' OR Field_X=@parameter). It greatly simplied the SQL query and fixed the problem of NULL value is hard to handle.
The post I saw is: http://dotnet.org.za/ilo/archive/2005/05/31/21280.aspx
Role-Playing Dimensions In Fabric Direct Lake Semantic Models Revisited
-
Back in September 2024 I wrote a blog post on how to create multiple copies
of the same dimension in a Direct Lake semantic model without creating
copies o...
1 week ago
No comments:
Post a Comment