如何在同一Power Bi Table中加入两个不同的日期?

问题描述 投票:-1回答:1

我需要比较表中的汇总结果,在POWER BI中将这两个不同的日期合并到同一个表中:

并最终得到这样的表格:

这是最好的方法吗?

powerbi
1个回答
0
投票

我无法在单个Dax表表达式中使用此解决方案,如果可以,请告诉我:

//Create a calculated table 
Date_New = (DISTINCT(UNION(SUMMARIZE('Date', 'Date'[CreatedDate]), SUMMARIZE('Date', 'Date'[EndDate]))))

//Add 2 calculated columns to it
Created = 
VAR TotalCreated = CALCULATE(COUNT('Date'[CreatedDate]), FILTER('Date', 'Date'[CreatedDate] = 'Date_New'[CreatedDate]) )
RETURN IF(ISBLANK(TotalCreated), 0, TotalCreated) 

Ended = 
VAR TotalEnded = CALCULATE(COUNT('Date'[EndDate]), FILTER('Date', 'Date'[EndDate] = 'Date_New'[CreatedDate]) )
RETURN IF(ISBLANK(TotalEnded), 0, TotalEnded) 

结果:

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.