Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
water-guy-5
Helper III
Helper III

Find the distinct count of a column within a certain date range

Hello, I am trying to find a distinct count of locations within the first 15 days of a month.

pbcomm2.pngpbcomm3.png

 

Basically the 45 card is filtered by the dates between slicer and the 49 card is set to "Do Not Interact". I would like a measure that calcuates the 45 without needing a slicer. Thanks!

1 ACCEPTED SOLUTION

@water-guy-5 , Try like

 

measure =

var _max1 = minx(allselected('Date'), 'Date'[date]) //selected value or take today

var _max = eomonth(_max,-1) +15

var _min = eomonth(_max,-1) +1

return

calculate(sum(Table[Value]), filter(Table, Table[Date] >=_min && Table[Date]<=_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@water-guy-5 , if you need based on today's date

 

measure =

var _max = today() // or today() -1

var _min = today() -15  //or 16

return

calculate(sum(Table[Value]), filter(Table, Table[Date] >=_min && Table[Date]<=_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

this will be for a kpi dashboard and the entire page will be filtered by relative date = in this month, so i don't need the specific days. more looking for "beginning of month", "beginning of month +15" or something like that.

@water-guy-5 , Try like

 

measure =

var _max1 = minx(allselected('Date'), 'Date'[date]) //selected value or take today

var _max = eomonth(_max,-1) +15

var _min = eomonth(_max,-1) +1

return

calculate(sum(Table[Value]), filter(Table, Table[Date] >=_min && Table[Date]<=_max))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.