DAX计算的关系 [英] DAX Calculated Relationship

查看:235
本文介绍了DAX计算的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 月,MyMeasure

  • 11月15日,150

  • b $ b
  • 200年1月16日
  • 200年2月16日 - 对未来的预测不理想

  • Mar-16, 200 - 预测未来不期望

  • 200年4月16日 - 预测未来不希望


我有一个度量,它使用ALL函数删除与日期表的关系,并在修改的上下文中计算distinctcount。这是很好,但现在的措施延伸到未来,直到日期表结束。

我需要在第一次计算后应用另一个过滤器:



如果日历[日期]<今天()
然后MyMeasure
ELSE空白



或者可能使用LOOKUPVALUE?

[< measure>]
,FILTER(
ALL('DimDate')$)$> $解析方案

b $ b,'DimDate'[Date]< = TODAY()



  • Month, MyMeasure
  • Nov-15, 150
  • Dec-15, 150
  • Jan-16, 200
  • Feb-16, 200 -- projections into the future not desired
  • Mar-16, 200 -- projections into the future not desired
  • Apr-16, 200 -- projections into the future not desired

I have a measure which uses an ALL function to remove the relationship to the date table and calculate a distinctcount in a modified context. Which is great but now the measure extends into the future until the end of the date table.

I need to apply another filter after the first calculation:

If calendar[date] < today() then MyMeasure ELSE blank

or maybe something using LOOKUPVALUE?

解决方案

CALCULATE(
    [<measure>]
    ,FILTER(
        ALL( 'DimDate' )
        ,'DimDate'[Date] <= TODAY()
    )
)

这篇关于DAX计算的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆