英文:
DAX formula to get the latest date based on multiple criteria
问题
我有这个在Power BI中用于度量的DAX公式,我需要返回最新的日期,如果它与表单名称匹配并且已经完成,即等于1(已完成字段要么是1,要么是0)。
我有以下公式,但它没有返回我想要的结果。即使[Finalized]为零,它仍然返回日期。我错在哪里?
Observed_Date =
CALCULATE (
MAX ( 'Form Results'[DateObserved] ),
'Form Results'[Formname] = "Office Worker"
&& MAX('Form Results'[Finalized]) = 1
)
英文:
I have this DAX formula for a Measure in PBI, I need to return the latest date if it matches the form name AND if it is Finalized i.e. equals 1 (the Finalized field is either 1 or 0).
I have the formula as below, however, it's not returning the result I want. It's still returning the date even when [Finalized] is zero. Where I got it wrong?
Observed_Date =
CALCULATE (
MAX ( 'Form Results'[DateObserved] ),
'Form Results'[Formname] = "Office Worker"
&& max('Form Results'[Finalized])=1
)
答案1
得分: 2
在你的 DAX 公式中移除对 'Form Results'[Finalized]
的 MAX
函数:
Observed_Date = CALCULATE ( MAX ( 'Form Results'[DateObserved] ), 'Form Results'[Formname] = "Office Worker" && 'Form Results'[Finalized] = 1 )
英文:
Remove max for 'Form Results'[Finalized])
in your dax formula
Observed_Date = CALCULATE ( MAX ( 'Form Results'[DateObserved] ), 'Form Results'[Formname] = "Office Worker" && 'Form Results'[Finalized])=1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论