cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Solution Sage

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!

9 REPLIES 9
Solution Sage

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!

Helper V

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

Solution Sage

@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!

Helper V

thank you, but I still get the below:

Solution Sage

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!

Helper V

Brilliant, thank you

Solution Sage

🙂 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!

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

Tutorial Series Dax Vs SQL Direct Query PBI Tips

Helper V

Thank you for replying

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

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors