Forum Discussion
Anonymous
7 years agoNot applicable
DAX - Allocate Program Type
I am looking for some DAX syntax with the following logic Table A - Columns - Work Order , Date Rec'd. Contract #, Net tons Table B Columns - Contract #, Net Tons, Program type I...
- 7 years ago
Hi Anonymous
You may add the index in query editor.Please check the file.
Regards,
Cherie
Anonymous
7 years agoNot applicable
Attached is were the problem in the last total is not allowing for proper allocation of the proram amount. I think it has to do with date receive. What would you recommend? v-cherch-msft
Here is the data and screen shot...Also attached the pb file.
Syntax =
LastTotal = CALCULATE(SUM(TableA[Total]),FILTER(TableA,TableA[Name]=EARLIER(TableA[Name])&&TableA[Date Receive]=EARLIER(TableA[Date Receive])-1))
Date ReceiveNameYearAmountTotalLastTotalProgramAContract No
| 1/2/2018 | a | 2018 | 150 | 150 | 150 | 1 | |
| 1/3/2018 | a | 2018 | 150 | 300 | 150 | 150 | 1 |
| 1/4/2018 | a | 2018 | 150 | 450 | 300 | 150 | 1 |
| 2/1/2018 | a | 2018 | 150 | 1650 | 500 | 1 | |
| 1/5/2018 | a | 2018 | 150 | 600 | 450 | 50 | 1 |
| 1/6/2018 | a | 2018 | 150 | 750 | 600 | 0 | 1 |
| 1/7/2018 | a | 2018 | 150 | 900 | 750 | 0 | 1 |
| 1/8/2018 | a | 2018 | 150 | 1050 | 900 | 0 | 1 |
| 1/9/2018 | a | 2018 | 150 | 1200 | 1050 | 0 | 1 |
| 1/10/2018 | a | 2018 | 150 | 1350 | 1200 | 0 | 1 |
| 1/11/2018 | a | 2018 | 150 | 1500 | 1350 | 0 | 1 |
| 1/2/2018 | b | 2018 | 150 | 150 | 150 | 2 | |
| 1/3/2018 | b | 2018 | 150 | 300 | 150 | 150 | 2 |
| 1/4/2018 | b | 2018 | 150 | 450 | 300 | 150 | 2 |
| 1/5/2018 | b | 2018 | 150 | 600 | 450 | 50 | 2 |
| 1/6/2018 | b | 2018 | 150 | 750 | 600 | 0 | 2 |
| 1/7/2018 | b | 2018 | 150 | 900 | 750 | 0 | 2 |
| 1/8/2018 | b | 2018 | 150 | 1050 | 900 | 0 | 2 |
Anonymous
7 years agoNot applicable
v-cherch-msft one more thing. There are multiple reciecpts per day per the same contract. My apologies for not displaying that in the model.
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
You may add the index in query editor.Please check the file.
Regards,
Cherie
- Anonymous7 years agoNot applicable
v-cherch-msft Worked perfectly! Huge thanks!!