Forum Discussion
saska10
9 years agoNew Member
how to sum values?
Hi everyone, I'm using Power BI desktop working on a car reporting task, and have been struggling with the following problem for days. I'm quite new to Power BI and have very basic DAX knowledge....
v-huizhn-msft
Microsoft Employee
9 years agoHi saska10,
It's difficult to reproduce your scenario based on your description, please list your expected result from the sample data sample. So that we can provide the solution which is close to your requirement. Thanks for understanding.
Best Regards,
Angelia
saska10
9 years agoNew Member
Hi v-huizhn-msft,
I want a result table like this:
| Date | Registration Number | Distance |
| 2017.02.28 | AAA001 | 120 |
| 2017.02.29 | AAA001 | 160 |
| 2017.03.03 | AAA001 | 230 |
| 2017.03.04 | AAA001 | 320 |
| 2017.03.08 | AAA001 | 190 |
| 2017.03.09 | AAA001 | 270 |
| 2017.03.12 | AAA001 | 370 |
| 2017.03.14 | AAA001 | 400 |
| 2016.03.16 | AAA001 | 280 |
| 2017.03.20 | AAA001 | 340 |
| 2017.03.21 | AAA001 | 350 |
| 2017.03.22 | AAA001 | 230 |
| 2017.03.23 | AAA001 | 250 |
| 2017.03.25 | AAA001 | 410 |
| 2017.03.27 | AAA001 | 370 |
| 2017.04.01 | AAA001 | 390 |
| 2017.04.02 | AAA001 | 240 |
All in all, the most important thing that the result table containts: from the day of refueling closest to the new month till the next new month's closest day of refueling.
Thank you for your help!
- v-huizhn-msft9 years ago
Microsoft Employee
Hi saska10,
For this result table, you can click New table under Modeling on home page, type the following formula.result-table=SELECTCOLUMNS(Distance,"Date",Distance[Date],"Registration Number",Distance[Registration Number],"Distiance",Distance[Distance])
Best Regards,
Angelia