Forum Discussion
Anonymous
3 years agoNot applicable
Total amount on Latest date
Friends, i have product table, that contains product id,date,amount. i would like to get total amount on latest date latest value by index. For example on date 14-Nov, total amount will be (290+...
- 3 years ago
Anonymous , I think these two blogs can help
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0
- 3 years ago
Anonymous
try to create a measure with the code below:
SumAmount =VAR Table1=SUMMARIZE(TableName,TableName[product_id],TableName[Date])VAR Table2=ADDCOLUMNS(Table1,"Index",CALCULATE(MAX(TableName[Index])))VAR MaxDate = MAX(TableName[Date])VAR Table3 =FILTER(Table2,TableName[Date] = MaxDate)VAR Table4 =TREATAS(Table3,TableName[product_id],TableName[Date],TableName[Index])VAR RESULT =CALCULATE(SUM(TableName[Amount]),Table4)RETURNRESULTI tried and it worked as below:
FreemanZ
3 years agoSuper User
why skip product 2116?
Anonymous
3 years agoNot applicable
by default the date will be latest date from entire table. when we select date slicer. if we select 15 Sep the amount will be 111( or it will add also another product it will fell on 15 sep)
- FreemanZ3 years agoSuper User
Anonymous
try to create a measure with the code below:
SumAmount =VAR Table1=SUMMARIZE(TableName,TableName[product_id],TableName[Date])VAR Table2=ADDCOLUMNS(Table1,"Index",CALCULATE(MAX(TableName[Index])))VAR MaxDate = MAX(TableName[Date])VAR Table3 =FILTER(Table2,TableName[Date] = MaxDate)VAR Table4 =TREATAS(Table3,TableName[product_id],TableName[Date],TableName[Index])VAR RESULT =CALCULATE(SUM(TableName[Amount]),Table4)RETURNRESULTI tried and it worked as below: - amitchandak3 years agoSuper User
Anonymous , I think these two blogs can help
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0