简体   繁体   English

Power BI 中报表数据的条件过滤

[英]Conditional Filtering on Report Data in Power BI

I have a table entry for multiple Product and Many different features.我有多个产品和许多不同功能的表条目。 All the data has date time in shown format.所有数据都有显示格式的日期时间。

在此处输入图片说明

As we can see that all products has entries across different time.正如我们所看到的,所有产品都有不同时间的条目。 My aim is to filter the details related to the product by latest time of everyday.我的目标是按每天的最晚时间过滤与产品相关的详细信息。

I was able to split the Time col in Date col & Time col separately.我能够分别在 Date col 和 Time col 中拆分 Time col。

You can achieve that by creating a new table in Dax for eg.您可以通过在 Dax 中创建一个新表来实现这一点,例如。 (because I don't know what do you want to do with rows with the same timestamp I show both rows for C) (因为我不知道你想对具有相同时间戳的行做什么,我为 C 显示了两行)

在此处输入图片说明

YourFilteredTable =
VAR __trt =
    TREATAS (
        SELECTCOLUMNS (
            ADDCOLUMNS (
                SUMMARIZE (
                    ADDCOLUMNS (
                        ALL ( YourTable[Product], YourTable[Time] ),
                        "day", DATEVALUE ( YourTable[Time] )
                    ),
                    YourTable[Product],
                    [day]
                ),
                "MaxDate", CALCULATE ( MAX ( YourTable[Time] ) )
            ),
            "Prod", [Product],
            "MaxDate", [MaxDate]
        ),
        YourTable[Product],
        YourTable[Time]
    )
RETURN
    SUMMARIZECOLUMNS (
        YourTable[Product],
        YourTable[Quant],
        YourTable[Time],
        __trt
    )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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