Forum Discussion
Creating a new table to normalize records from a second table
- 1 year ago
Hi ClausS - you can try below suggested solutions and request from Sahir_Maharaj and uzuntasgokberk .
giving another alternative with a new calculated table logic as below
CalculatedTable =VAR ExpandedTable =GENERATE(TableA,ADDCOLUMNS(GENERATESERIES(0,INT(DATEDIFF(TableA[StartDate], TableA[EndDate], MONTH) / 12),1),"GeneratedStartDate",EDATE(TableA[StartDate], [Value] * 12),"GeneratedEndDate",EDATE(TableA[StartDate], ([Value] + 1) * 12) - 1,"ProratedValue",TableA[Value] / TableA[Years]))RETURNSELECTCOLUMNS(ExpandedTable,"RecID", TableA[RecID],"Name", TableA[Name],"StartDate", [GeneratedStartDate],"EndDate", [GeneratedEndDate],"Value", [ProratedValue],"Years", 1)Hope this works please check.
Hi ClausS - you can try below suggested solutions and request from Sahir_Maharaj and uzuntasgokberk .
giving another alternative with a new calculated table logic as below
- ClausS1 year agoHelper I
Thx for your work, I think something is missing. I get the error message "The arguments in GenerateSeries function cannot be blank."
Can we include a statement to make sure records with incorrcet data (Like no start or end date) will be skipped?
BR
Claus - ClausS1 year agoHelper I
I added an IF Statement around the "INT(DATEDIFF(TableA[StartDate], TableA[EndDate], MONTH) / 12)" to make sure the Result is greater 0 and now it works. Data is never be perfect 🙂
Thx again for your great help.
Claus