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

NEED HELP

Hi All,

          I need help in calculating the dates difference for one of my scenario as below

i want to calculate current date minus invoice date >7 or invoice date  is null as single calculation.could some body please help me on this .

 

Regards

Neetha

 

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

You can try the following methods.
Sample data:

vzhangti_0-1670570851307.png

Column:

Difference = DATEDIFF([Invoice date],TODAY(),DAY)

vzhangti_1-1670570879322.png

Measure = CALCULATE(SUM('Table'[Count]),FILTER(ALL('Table'),[Difference]>7))
           +CALCULATE(SUM('Table'[Count]),FILTER(ALL('Table'),[Invoice date]=BLANK()))

vzhangti_2-1670570953145.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
hnguy71
Memorable Member
Memorable Member

Hi @Anonymous ,

 

Fantastic! You've supplied a sample output, do you mind supplying some sample input as well? How did you get those 1s and 4s when the current date is December 8, 2022?



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Anonymous
Not applicable

HI hnguy,

                    its the invoice count i placed for test data.

hnguy71
Memorable Member
Memorable Member

Hi @Anonymous ,

 

It's always nice if you can supply a sample data and expected output. The more detailed the information the better. With what you've given, the best anyone can do is nudge you in the right direction.

 

Your expression would be:

CALCULATE([YOUR_MEASURE], YOUR_DATE_FIELD > TODAY() - 7 || YOUR_INVOICE_FIELD = BLANK() )


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Anonymous
Not applicable

Hi hnguy,

below is the screen shot of data.i want to calculate the current date - invoice date >7 or invoice date is null so that i know how many invoices are delayed

NeethaM_0-1670509069575.png

 

Hi, @Anonymous 

 

You can try the following methods.
Sample data:

vzhangti_0-1670570851307.png

Column:

Difference = DATEDIFF([Invoice date],TODAY(),DAY)

vzhangti_1-1670570879322.png

Measure = CALCULATE(SUM('Table'[Count]),FILTER(ALL('Table'),[Difference]>7))
           +CALCULATE(SUM('Table'[Count]),FILTER(ALL('Table'),[Invoice date]=BLANK()))

vzhangti_2-1670570953145.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Hnguy,

                 Thanks for quick reply.

i want to calculation as if current date - invoice date >7days or invoice date is null.

i dont have any measures.

 

Hi @Anonymous ,

 

If you don't currently have a base measure, then it would be the aggregate value of whatever field you're attempting to calculate.

 

Replace [YOUR_MEASURE] with whatever you're attempting to do... perhaps a SUM, AVERAGE, MAX, etc.

 

Am I understanding your request?



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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.