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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
aak
Helper I
Helper I

Calculating the number of minutes between dates in slicer

Hi,

 

I have a question I am hoping someone can answer. Basically I have a table that has a date for each record. There are not records for each date. For instance, there may be a record on 3/1/2021 and 4/13/2021, but those are the only ones. I have a slicer that utilizes this date as the filter. The problem comes that I am trying to analyze some numbers, but I need to calculate the number of minutes in the date slicer. For instance, if the date range selected is 4/1/2021 - 4/30/2021, I need the number of minutes between those two dates. Is there any way to do this?

4 REPLIES 4
Anonymous
Not applicable

[Num of Mins] =
var MinDate = MIN( Slicer[Date] )
var MaxDate = MAX( Slicer[Date] )
var MinCount =
    ( MaxDate - MinDate ) // num of days
        * 24    // num of hours in a day
        * 60    // num of mins in an hour
return
    MinCount

Thanks. My issue is that I don't know the DAX to get "Slicer[Date]" since "Slicer" isn't recognized.

Anonymous
Not applicable

Since you have not given us any clue about your tables and their names... well, I used a generic name. You should now adjust it to your model.

Well, say I have a field for "Date of Incident". That may only have a few days in it. For instance one issue on 4/5/2021. The slicer might be looking from 3/15/2021 to 5/31/2021. If I do Max or Min on the Date of Incident, I will get 4/5 instead of the beginning or ending date in the slicer. I'm trying to target the actual date range in the slicer, not the records.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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