Forum Discussion
How do I use a date filter for a measure?
- 4 years ago
Hi HamidBee.
I'm assuming that you have a date table in your data model and that it is marked appropriately. If so, this should be fairly easy with either the DATESBETWEEN or DATESINPERIOD functions. Pick a function and insert the appropriate start and end dates as parameters. Hope this helps!
Hi,
You can simplify your measure to
Count = CALCULATE(COUNTROWS('Table'),'Table'[Letter]="A")
Create a Calendar Table and build a relationship (Many to One and Single) from the Date column of your Table to the Date column of the Calendar Table. Write calculated column formulas in the Calendar table to extract Year, Month name and Month number. Sort Month name by Month number in the Calendar Table. Build slicers for Year and Month name. Select a Year and Month in the slicers.
Hope this helps.
Ashish_Mathur Nice to see that discussion from our meetings about people swooping in and offering multiple solutions from Super Users is being honored. Does nothing more than confuse users and pad stats. But good job!