Forum Discussion
Need help on classifying value
- 4 years ago
Hi, VoltesDev ;
Try it.
Measure = var _1m=CALCULATE(SUM([Qty]),FILTER(ALL('Table'),[Item]=MAX('Table'[Item])&&[month]="1 month")) var _2m=CALCULATE(SUM([Qty]),FILTER(ALL('Table'),[Item]=MAX('Table'[Item])&&[month]="2 month")) var _3m=CALCULATE(SUM([Qty]),FILTER(ALL('Table'),[Item]=MAX('Table'[Item])&&[month]=">2 month")) var _total=SWITCH( MAX([month]),"1 month",IF(_1m+_2m> 0&&_1m<0,_1m+_2m,0),"2 month",IF(_1m+_2m<0,_1m+_2m+_3m,_2m),">2 month",IF(_1m<0&&_1m+_2m>0,_3m-_2m,0)) return IF(HASONEVALUE('Table'[month]),_total,SUM('Table'[Qty]))The final output is shown below:
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
VoltesDev can you please provide sample data and desired output in table format?
- VoltesDev4 years agoHelper V
Hi smpa01 ,
I'm sorry, I hope this is applicable ?
Item Date Qty ItemA
9/1/2021 10 ItemA 10/1/2021 5 ItemA 11/1/2021 2 ItemA 11/1/2021 -5 ItemB 10/1/2021 3 ItemC 9/1/2021 4 ItemC 10/1/2021 3 ItemC 11/1/2021 -5 And the grouping :
Age From To 1 month 0 30 2 month 31 60 > 2 month 61 9999 And the expectation is like this :
Many thanks in advance.
- VoltesDev4 years agoHelper V
Hi smpa01 ,
So sorry but I seems cannot get the table right, tried many ways, from copying from excel, insert table from this tools and copy from excel again until I tried to insert table again and key in manually one by one, but it looks terrible after post.
But if I tried to copy back, it is already in table format. I'm not sure what's going on with this editor.
Thanks