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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Pricey79
Helper V
Helper V

Date Query

Hello

I have a problem that I cant solve.

I have a column in date form titled required date. I would like to know how I could get a card to show me how many items are due in the next two weeks, and how many items are required completely please?

Could anyone help?

Thank you 

1 ACCEPTED SOLUTION

@Pricey79 . 

 

You are not closing DISTINCTCOUNT. 

 

Please use ) after giving the column. 

 

Regards, 

Manikumar

 

If you think this is helpful Please Accept as Solution and leave a like





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

9 REPLIES 9
manikumar34
Solution Sage
Solution Sage

@Pricey79 ,

Use the below to check the last 14 days distinct values. 

 

Measure =
CALCULATE(DISTINCTCOUNT('Table'[Value]),DATESINPERIOD(LASDATE('Table'[Date]),-14,DAY))





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




@manikumar34 

Thank you for your reply. 

Using your solution I get the error message :

 

Too few arguments were passed in DATESINPERIOD fucntion. The minium argument count for the function is 4 

 

 

@Pricey79 , hey Sorry. 

 

I was missing to refre the Dates columns. 

 

Measure =
CALCULATE(DISTINCTCOUNT('Table'[Value]),DATESINPERIOD('Table'[Date],LASDATE('Table'[Date]),-14,DAY))

 

Check with the above

 

Reards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




@manikumar34 

 

thank you, but I still get the below:

 

Pricey79_0-1602495960687.png

 

@Pricey79 . 

 

You are not closing DISTINCTCOUNT. 

 

Please use ) after giving the column. 

 

Regards, 

Manikumar

 

If you think this is helpful Please Accept as Solution and leave a like





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




@manikumar34 

 

Brilliant, thank you

@Pricey79 , 

🙂 Awesome, you got the answer. 

 

Your Kudo will be appreciated. 

 

Regards, 

Manikumar





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




amitchandak
Super User
Super User

@Pricey79 , Something like this

 

Measure =
var _min = maxx(allselcted('Table'),'Table'[Date])
return
calculate(count('Table'[Value]),filter('Table','Table'[Date] >=_min && 'Table'[Date] <= _min + 14))

 

you can use distinctcount inplace of count

 

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak 

 

Thank you for replying

 

I'm afraid thats a bit complicated for me, I am a real novice at this. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.