In a table, I am having a column with the date. I have only 6 months of Date in the table.
When I pull the column to a slicer, it shows the first date and last date correctly where as when I pull the date to a table, it lists all the months. Is this a bug?
I want to calculate the number of months I have selected, but the measure always ends up showing 12 instead of 6.
The measure I am using is
CountOfMonths = DATEDIFF(FIRSTDATE(Table1[SampleDate].[Date]), LASTDATE(Table1[SampleDate].[Date]),MONTH)
No, it’s not a bug. After dragging to the table, find the date column drop down arrow (right hand side in the fields list, rows section) click the drop down arrow and change to date. This is the auto date hierarchy at work.
When we are dragging a particular column from a table which just contains 6 months of data, the data hierarchy should display only the 6 months right. Please correct me if I am wrong.
Also the measure for some reason displays 11 months and not 12. What formula should I use for the measure for it to properly show the value as 6?