Forum Discussion
Direct Query Filtering Values in Visual based on another Columns Values
- 1 year ago
Hi ChazTime,
Thank you for your detailed follow-up and your efforts in debugging the scenario.
While the ShowVIS logic functions correctly in a straightforward setup, the inclusion of additional filters such as Loc ID in a DirectQuery model may cause the measure to malfunction. This is due to the manner in which DAX is evaluated and translated into SQL. When complex filters are applied or measures rely on CALCULATE logic involving related tables, Power BI’s query folding can behave unpredictably in DirectQuery mode. This may result in incorrect or uniform outputs, for example, all values being 1.
Kindly consider the following workaround options which might assist in resolving the issue:
- Use a SQL view to pre-aggregate or filter the data at the source.
- Employ a composite model (Import + DirectQuery) for enhanced flexibility in DAX.
If you find our response helpful, please mark it as the accepted solution and provide kudos. This will help other community members encountering similar queries.
Should you have any further questions, please feel free to reach out to the Microsoft Fabric community.
Thank you.
Thankyou, lbendlin, for your response.
Hi ChazTime,
We sincerely appreciate your inquiry on the Microsoft Fabric Community Forum.
Kindly find attached the screenshot and PBIX file, which may assist in resolving the issue:
If you find our response satisfactory, we would be grateful if you could mark it as the accepted solution and kindly provide kudos. This will help other community members who may have similar queries.
Thank you
- ChazTime1 year agoFrequent Visitor
Hi v-pnaroju-msft ,
Thank you for the response and pbix file. Unfortunelty your solution cannot work because I am using a Direct Query. The 'CALCULATE' function is not allowed. I changed from a calculated column to a measure but it still did not work. See error below.