-1

I need to compare summarized results from a table, merging two differents dates in the same table like this in POWERBI:

And end up with a table like this:

Which is the best way to do it?

obscure
  • 11,916
  • 2
  • 17
  • 36
Maria
  • 35
  • 1
  • 4
  • Data in text format is useful to reproduce the error. Please follow here https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example?rq=1 – cropgen Apr 17 '19 at 20:02

1 Answers1

0

I could not fit this solution in single Dax table expression, let me know if you can do it:

//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) 

Result:

enter image description here

Pratik Bhavsar
  • 808
  • 8
  • 32