简体   繁体   中英

Power bi - Use Slicer selection in filtering data

I am new to Power bi but i want to use Slicer(user selection) while filter data with comparison by 'Greater Than' instead of equal to.

I have data of devices with LastUpdated date column. and slicer with few list of dates for 15 days gap (calendar would be better but as it is not available yet sticking with dates list)

When user select a date in Slicer i want to filter the data whose Lastupdated Date is greater than equal to selected date. How to achieve this? tried columns,measures..

Any help is appreciated.

I think you can create a measure that links the Date list table and the Device table, even if there is no relationship between them. However the measure must be present in your visualization otherwise the slicer will not affect it.

I've created a measure that calculates the maximum date for those rows which last update date is greater or equal than the slicer selection.

CalculatedLastUpdate =
CALCULATE (
    MAX ( DeviceTable[LastUpdate] ),
    FILTER (
        DeviceTable,
        DeviceTable[LastUpdate] >= MINX ( DateList, DateList[Date] )
    )
)

DateList - a table containing a column [Date] with you date range.
DeviceTable - a table containing device data.

在此处输入图片说明

Now you can delete LastUpdate column from your visualization in order to avoid two columns with the same data.

Let me know if it helps.

我不知道更早,但现在您可以修改日期切片器以在给定日期“之后”执行(您可以通过单击切片器视觉本身最右侧的图标来实现,您可以在其中选择切片器模式为 between , after ,list , dropdown 等)...我相信这意味着您将获得大于切片器中使用的给定列的选定日期的所有数据,在您的情况下为LastUpdate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM