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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

@Anonymous You should be able to do:

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


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@Anonymous You should be able to do:

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


@ 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!:
The Definitive Guide to Power Query (M)

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?


@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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