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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

count days from a slicer date

Hello Experts,

how do i get the dax for no of days from the date slicer?

I wanted to show the count between below date range and i dont want to use relative date. Once i get the count of days then again i need to calculate 3*1440(how iam this number is 24hrs in a day and 60minutes per hour so 24*60=1440)

I tried min, max, selectedvalue but no luck. Could you please help me someone

 

venkatcgn3_0-1652889879189.png

Below is the actual requirement from customer and GPH is a measure

venkatcgn3_0-1652890577795.png

 

 

Regards,

Venkat

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous You should be able to do:

Count Measure = ( MAX('Dates'[Date]) - MIN('Dates'[Date]) ) * 1.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

@Anonymous You should be able to do:

Count Measure = ( MAX('Dates'[Date]) - MIN('Dates'[Date]) ) * 1.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler i tried already without multiplication 1 and now i tried as you said but no luck and even i tried with countrows that also not working

venkatcgn3_0-1652895267088.png

venkatcgn3_1-1652895338475.png

Regards,

Venkat

 

@Anonymous So, what is the purpose of the 2 slicers?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Just for illustration purpose only showed relative date slicer. Only required Date slicer. 

Can anyone help me on the dax? @MFelix @amitchandak @Ashish_Mathur any help here

Hi @Anonymous ,

 

I have made a test and all the metrics refered here work properly, no issues on the calculation, believe that you may have some relationship, or context filter that is causing this calculation to not work.

 

Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

@Greg_Deckler Thank you greg. its working both solutions after i reviewed joins.

@MFelix Thanks Felix for your valuable suggestions

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.

Top Solution Authors