我有一个包含以下格式数据的Excel工作表
UploadDate Grant Family Project Officer
05/04/2019 00J90301 AA
05/04/2019 01J32201 AA
05/04/2019 97891601 AA
05/04/2019 00406918 AB
05/04/2019 00406015 AC
05/04/2019 00406515 AC
05/04/2019 00406715 AC
05/04/2019 00406815 AC
05/04/2019 00526416 AC
05/04/2019 00571110 AC
05/04/2019 00D28115 AC
05/04/2019 00D28215 AC
05/04/2019 00D28315 AC
05/04/2019 00D28415 AC
05/04/2019 00D29215 AC
05/04/2019 00D29515 AC
05/04/2019 00D30415 AC
05/04/2019 00D30715 AC
05/04/2019 00D30815 AC
05/04/2019 00D31015 AC
05/04/2019 00D41515 AC
05/04/2019 00D49516 AC
05/04/2019 00D63217 AC
05/04/2019 00D63317 AC
05/04/2019 00E01521 AC
05/04/2019 00E01547 AC
05/04/2019 00E01999 AC
05/04/2019 00E02038 AC
05/04/2019 00E02335 AC
05/04/2019 00E02338 AC
05/04/2019 00E16405 AC
05/04/2019 00E66504 AC
05/04/2019 00E66603 AC
05/04/2019 00E66604 AC
05/04/2019 02E01503 AC
05/04/2019 83579302 AC
05/04/2019 95490317 AC
05/04/2019 97431017 AC
05/04/2019 98408917 AC
05/04/2019 98409217 AC
05/04/2019 98485117 AC
05/04/2019 98490416 AC
05/04/2019 99060104 AC
05/04/2019 99407714 AC
05/04/2019 99446514 AC
05/04/2019 00T26201 AD
05/04/2019 00T76718 AD
05/04/2019 00T77117 AD
06/11/2019 00J90301 AA
06/11/2019 01J32201 AA
06/11/2019 97891601 AA
06/11/2019 00406918 AB
06/11/2019 00406015 AC
06/11/2019 00406515 AC
06/11/2019 00406715 AC
06/11/2019 00406815 AC
06/11/2019 00526416 AC
06/11/2019 00571110 AC
06/11/2019 00D28115 AC
06/11/2019 00D28215 AC
06/11/2019 00D28315 AC
06/11/2019 00D28415 AC
06/11/2019 00D29215 AC
06/11/2019 00D29515 AC
06/11/2019 00D30415 AC
06/11/2019 00D30715 AC
06/11/2019 00D30815 AC
06/11/2019 00D31015 AC
06/11/2019 00D41515 AC
06/11/2019 00D49516 AC
06/11/2019 00D63217 AC
06/11/2019 00D63317 AC
06/11/2019 00E01521 AC
06/11/2019 00E01547 AC
06/11/2019 00E01999 AC
06/11/2019 00E02038 AC
06/11/2019 00E02335 AC
06/11/2019 00E02338 AC
06/11/2019 00E16405 AC
06/11/2019 00E66504 AC
06/11/2019 00E66603 AC
06/11/2019 00E66604 AC
06/11/2019 02E01503 AC
06/11/2019 83579302 AC
06/11/2019 95490317 AC
06/11/2019 97431017 AC
06/11/2019 98408917 AC
06/11/2019 98409217 AC
06/11/2019 98485117 AC
06/11/2019 98490416 AC
06/11/2019 99060104 AC
06/11/2019 99407714 AC
06/11/2019 99446514 AC
06/11/2019 00T26201 AC
06/11/2019 00T76718 AC
06/11/2019 00T77117 AC
我们的PowerBI文件具有一些表,这些表返回在特定的上载日期,在1-2个补助金家庭之间,在3-9个之间,以及在20个以上的家庭中从事过多少项目干事。我们已经检查了这些数字和过滤器,它们可以工作。
我们的下一个目标是展示上传日期之间的差异。
我创建了DAX措施,
PO_Difference = Calculate(DistinctCount('Report'[Project Officer]),'Report'[Upload Date] = date (2019,11,6))-Calculate(DistinctCount('Report'[Project Officer]),'Report'[Upload Date] = date (2019,4,5))
'
并且它没有返回我们的预期结果。如果将公式一分为二,则在应用相应的过滤器后,两个计算部分都将返回预期结果,但是我的直觉是,过滤器会使每个部分的公式返回的值失真,而我无所适从。任何帮助将不胜感激。
答案 0 :(得分:0)
您可以尝试使用变量吗?
PO_Difference =
VAR x = Calculate(DistinctCount('Report'[Project Officer]),'Report'[Upload Date] = date (2019,11,6))
VAR y = Calculate(DistinctCount('Report'[Project Officer]),'Report'[Upload Date] = date (2019,4,5))
return x -y