Forum Discussion
issue with report
- Anonymous1 year ago
Thanks for the replies from Angith_Nair, Rupak_bi and Kedar_Pande.
Hi moronilms,
Based on your description I created simple data:
Please try the following steps:
1.Create a new table:
Newtable = CROSSJOIN('company','date')2.Create a new column:
Balance = LOOKUPVALUE('Table'[balance],'Table'[company_id],'Newtable'[company_id],'Table'[date],'Newtable'[Date])3.The relationships like this:
4.Create a new measure:
Newbalance = VAR _Previousdate = CALCULATE(MAX('Newtable'[Date]),FILTER(ALLEXCEPT('Newtable','Newtable'[company_id]),NOT('Newtable'[Balance]=BLANK()))) VAR _interval=DATEDIFF(_Previousdate,MAX('Newtable'[Date]),DAY) return IF(MAX('Newtable'[Balance])=BLANK(),CALCULATE(MAX('Newtable'[Balance]),FILTER(ALLEXCEPT('Newtable','Newtable'[company_id]),'Newtable'[Date]=MAX('Newtable'[Date])-_interval)),MAX('Newtable'[Balance]))5.The results are as follows:
Best Regards,
ZhuIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the replies from Angith_Nair, Rupak_bi and Kedar_Pande.
Hi moronilms,
Based on your description I created simple data:
Please try the following steps:
1.Create a new table:
Newtable = CROSSJOIN('company','date')
2.Create a new column:
Balance = LOOKUPVALUE('Table'[balance],'Table'[company_id],'Newtable'[company_id],'Table'[date],'Newtable'[Date])
3.The relationships like this:
4.Create a new measure:
Newbalance =
VAR _Previousdate = CALCULATE(MAX('Newtable'[Date]),FILTER(ALLEXCEPT('Newtable','Newtable'[company_id]),NOT('Newtable'[Balance]=BLANK())))
VAR _interval=DATEDIFF(_Previousdate,MAX('Newtable'[Date]),DAY)
return
IF(MAX('Newtable'[Balance])=BLANK(),CALCULATE(MAX('Newtable'[Balance]),FILTER(ALLEXCEPT('Newtable','Newtable'[company_id]),'Newtable'[Date]=MAX('Newtable'[Date])-_interval)),MAX('Newtable'[Balance]))
5.The results are as follows:
Best Regards,
Zhu
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.