本文介绍了传递给查询的 PowerBI 切片器值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从 SQL 查询生成的报告,其中包含一个截止日期列.我的要求是创建一个切片器,无论用户在切片器中选择什么日期,报告都应显示截止日期小于所选切片器日期的所有数据.

I have a report generated from a SQL query, having a due date column. My requirement is to create a slicer and  whatever the date a user selects in the slicer the report should show all the data where due date is less than the selected slicer date.

我无法将切片器日期传递给我的 SQL 查询.

I am not able to pass the slicer date to my SQL query. 

你能指导我找到最好的方法吗?

Can you guide me guys in finding the best possible way?

推荐答案

这在一般情况下是不可能的.在报表页面上设置的切片器和过滤器不能修改模型(例如计算表或计算列),也不能修改查询.

This is not possible in general. Slicers and filters set on a report page cannot modify the model (e.g. calculated tables or calculated columns) and cannot modify the queries.

执行此类操作的唯一可能方法是使用 DirectQuery,它会在后台自动执行此操作,因为它仅动态查询所需数据.否则,您需要预先加载您打算在报告中使用的所有数据.

The only possible way to do this sort of thing is with a DirectQuery, which does it automatically in the background since it dynamically queries only the needed data. Otherwise, you need to pre-load all of the data that you intend to use in the report.

使用 DirectQuery 有很大的局限性,可能或者可能不适用于您的用例.有关详细信息,请查看链接文档中的限制和注意事项.

Using DirectQuery has significant limitations and may or may not work for your use case. Please check the limitations and considerations in the linked documentation for details.

这篇关于传递给查询的 PowerBI 切片器值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 09:48
查看更多