Filter a column dynamically using a measure in Power BI

∥☆過路亽.° 提交于 2019-12-14 03:08:49

问题


There is a column with FY i.e. "FY19","FY18","FY17" etc.

I Created a measure which calculates the current FY:

CurrFY =
CONCATENATE (
    "FY",
    IF (
        MONTH ( TODAY () ) <= 3,
        VALUE ( FORMAT ( TODAY (), "YY" ) ),
        VALUE ( FORMAT ( TODAY (), "YY" ) ) + 1
    )
)

e.g. output: "FY19"

Now i need to filter the report based on the FY column using the current FY i get from the CurrFY measure.

How do i do it?


回答1:


Create a calculated column on your table using that measure

FYFilter = IF(Table1[FY] = [CurrFY], 1, 0)

Then add that column as a report level filter where FYFilter is 1.



来源:https://stackoverflow.com/questions/54221320/filter-a-column-dynamically-using-a-measure-in-power-bi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!