Forum Discussion

SirJJAnderson's avatar
SirJJAnderson
Icon for Helper III rankHelper III
6 years ago

How to Create Measure to Count Dates within Filter/Slicer Range Only

Is there a formula I can use to create a measure that counts only the dates within the range of my slicer? I have multiple date columns and some are going to have dates outside of my slicer because other date columns in the dataset have dates within my slicer.

 

See outlined in red, the count is counting all of the rows with dates, including rows with dates prior to March. Want it to count only dates in March, giving me a total of 43 or so instead of 53.

 

2 Replies

  • SirJJAnderson , Not sure I got it.

    But you can use countdistinct of that date column

     

    Total dates = distinctcount(Table[Date])

    Or

    vMeausre =

    datediff(min(Table[Date]),max(Table[Date]),day)

  • v-diye-msft's avatar
    v-diye-msft
    Icon for Community Support rankCommunity Support

    Hi SirJJAnderson 

     

    What's the formula details in your measure?

     

    you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive for business and share the link to the file. Please do not forget to describe the expected results based on this sample data.