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

Invoice date greater calendar date

When I select the date May-05-2018 its shows me the remaining dates from May-06-2018 to till Sept-09-2020. for that, I create a

CALCULATE([DD Sales],NEXTDAY('Calendar'[Date]))

its display only one date next data. like May-06-2018 how to get the remaining dates data May-07-2018 to till Sept-09-2020

then try following measure but there is one issue less of then the date is also 1, kindly guide how to resolve?

Measure = 
  VAR _Date = SELECTEDVALUE('Calendar'[Date])
  Var _Date2 = DATESINPERIOD ('Calendar'[Date],MAX ('Calendar'[Date]),-1,YEAR)
  Var _Date3 = DATESMTD('Calendar'[Date])
  Var _Date4 = MAX('Calendar'[Date])
RETURN
  IF(_Date>MAX('Test Data'[InvoiceDate]),1,0)

demo.PNG 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

Hello @M_OVAISJANZEB

Try this meausre on your visual:

DATESINPERIOD = CALCULATE (
    SUM('Test Data'[Sales]),
    DATESINPERIOD (
        'Calendar'[Date],
        MAX ('Calendar'[Date]),
        3,
        YEAR
    )
)

Best regards

Lin

Community Support Team _ Lin
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

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

Hello @M_OVAISJANZEB

Try this meausre on your visual:

DATESINPERIOD = CALCULATE (
    SUM('Test Data'[Sales]),
    DATESINPERIOD (
        'Calendar'[Date],
        MAX ('Calendar'[Date]),
        3,
        YEAR
    )
)

Best regards

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

@Anonymous - Not sure what the issue is, is it specified? Can you post sample source data as text and expected output?

 

Not a fan of T"I" functions. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008


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

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.