Forum Discussion
Anonymous
7 years agoNot applicable
Comparing data with selected months and previous months
Hello,
I have a table called customer Transaction . Please find sample data as below. It has many rows with other cust id, year and month.
| Cust Id | Year | Month | Col1 | Col2 |
| 1 | 2019 | JAN | 5 | 10 |
| 2 | 2019 | JAN | 2 | 20 |
| 3 | 2019 | JAN | 3 | 30 |
| 4 | 2019 | JAN | 10 | 100 |
| 1 | 2019 | FEB | 1 | 200 |
| 2 | 2019 | FEB | 2 | 20 |
| 6 | 2019 | FEB | 300 | 400 |
I want to select year and month through Slicer and calculate New customers sales and no sales customers.
For Example if I select year= 2019 and Month = FEB, result should display as below after comparing previous month. I used calculated table, its working hard code value but not through slicer.
Please Help!!!!!!!
| New Customers | ||||
| Cust Id | Year | Month | Col1 | Col2 |
| 6 | 2019 | FEB | 300 | 400 |
Customers removed this month
| Cust Id | Year | Month | Col1 | Col2 |
| 3 | 2019 | JAN | 3 | 30 |
| 4 | 2019 | JAN | 10 | 100 |
Regards
Samar
No Replies