Forum Discussion
Find the count for last month
Hi ,
you can try this measure,
PreviousMonthCount = CALCULATE( COUNT('YourTable'[Column]), FILTER( 'YourTable', YEAR('YourTable'[Date]) = YEAR(TODAY()) && MONTH('YourTable'[Date]) = MONTH(TODAY()) - 1 ) )
or else you can provide sample data in table format.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
manvishah17
Here's the link to the pbix for better understanding of data and requirement.
https://drive.google.com/drive/folders/1VQJIre2xbFHDkyJ4GTvKUkhyus4VPmuM?usp=sharing
- Anand242 years ago
Super User
aditya_141228 ,
Your slicer will be on Month? Currently there are no values for April 2024 in your data.
Is it that you want to select a month (say Feb'24) and it's previous month's (Jan'24) count would be analyzed in Donut Chart?- aditya_1412282 years ago
Helper I
Yes that's exactly what I want to do, a month slicer will be there and I want the count of rating in the second donut which will give me the data of the previous month.
- Anand242 years ago
Super User
aditya_141228 ,
Use this DAX in a new calculated measure and pull it into your donut chart:Previous Month Count =
CALCULATE(
COUNT('Master Sheet (2)'[Rating]),
DATEADD('Date'[Date], -1, MONTH)
)Result:
- manvishah172 years ago
Solution Supplier
hey aditya_141228 can you please tell from which table you want count n from which table you will plot month slicer ??
- aditya_1412282 years ago
Helper I
We'll be using Master sheet 2 for count and for date we can use either a different table related to the Master Sheet 2 or we can use Date of Discovery column in Master Sheet 2.