Forum Discussion
Distinct count based on the sum and month
- 6 years ago
Anonymous , Try like
countx(filter(summarize(Table, Table[Vehicle Number], "_1",
CALCULATE(sum(Table[Km Driven]),DATESINPERIOD(Master_Data[Month ],MAX(Master_Data[Month ]),-3,MONTH))),[_1]<10),[Vehicle Number])I am hosting a webinar on 25th April on Power BI, Check Details - https://www.linkedin.com/posts/amitchandak78_webinar-tech-techforgood-activity-6658266754378231808-ye5L
Hi Anonymous
Can you add a table with the expected result?
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Hi,
Please check I have alreadt given a table consisting month, Vehicle number and Km driven in month. I want to sum up all the vehicle km driven and then to calculate the distinct count of number of vehicle for last three month.
For example
| Month | Vehicle | Km Driven |
| Jan 2020 | A13 | 3 |
| Dec 2019 | A13 | 4 |
| Oct 2019 | A13 | 11 |
| Jan 2020 | A12 | 6 |
| Dec 2019 | A12 | 3 |
| Oct 2019 | A12 | 0.5 |
I am looking for the sum of all vehicle km driven in last 3 months i.e A12 driven 9.5 km and A13 driven 19KM (hence need to exclude it from the data) and the answer of unique vehicle would be A12 only i.e 1