如何根据年份使用动态名称来创建动态措施?
目前,我在不同的几年中创建了一个度量MarketPrice
以下几年:
marketprice 2021 = CALCULATE(LASTNONBLANKVALUE(table[column1],
SUMMARIZE(FILTER(table, table[year] = 2021), table[column1])))
marketprice 2022 = CALCUALTE(........)
marketprice 2023 = CALCUALTE(........)
marketprice 2024 = CALCUALTE(........)
但这不是动态的,因为明年(2023年)我只需要从2022,2023,2023,2024,2025年开始的市场价格(在DAX语法中:Year(loday()) - 1
,Year(today())
,YearS(today()()())+1
, 年(today()())+2
)。我不想每年更改措施计算中的量度名称和年份输入。
我希望这是可能的。
At the moment I create a measure marketprice
for different years as the following:
marketprice 2021 = CALCULATE(LASTNONBLANKVALUE(table[column1],
SUMMARIZE(FILTER(table, table[year] = 2021), table[column1])))
marketprice 2022 = CALCUALTE(........)
marketprice 2023 = CALCUALTE(........)
marketprice 2024 = CALCUALTE(........)
But this is not dynamic because next year (2023) I only need the market prices from the years 2022, 2023, 2024, 2025 (in DAX syntax: YEAR(TODAY())-1
, YEAR(TODAY())
, YEAR(TODAY())+1
, YEAR(TODAY())+2
). I don't want to change every year the measure names and year-input in the measure calculation.
I hope this is possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能创建动态度量名称,而是可以通过动态计算尝试一下: -
You cant create dynamic name of measure instead you could try this with dynamic calculation:-