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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sean-OReilly
Helper IV
Helper IV

Cant get Today to work with Datesinperiod

Hi

I can't get Today () to work when I use a DatesinPeriod measure.

It just returns a blank value.

What am i doing wrong?

Here is the measure I created.

Costs last 2 months = calculate ( sum(MK_Job_LedgerEntries[Total_Cost_LCY]), DATESINPERIOD(MK_Job_LedgerEntries[Posting_Date], today(), -2, MONTH ))
1 ACCEPTED SOLUTION

Hi @amitchandak 

Thanks again for your help.

 

I got it to work - i was missing the .[date] after chosing the datesinperiod date 

SeanOReilly_0-1688486631678.png

 

View solution in original post

4 REPLIES 4
Sean-OReilly
Helper IV
Helper IV

I aslo get blank result when i try this 

Costs last 2 months v3 = calculate ( SUM(MK_Job_LedgerEntries[Total_Cost_LCY]), DATESINPERIOD(MK_Job_LedgerEntries[Posting_Date], DATE(2023,07,04),-1, year ))
 
amitchandak
Super User
Super User

@Sean-OReilly , Hope you have data for last 2 month, Also prefer to use a date table joined with date of your table

 

Rolling 2 = CALCULATE( sum(MK_Job_LedgerEntries[Total_Cost_LCY]) ,DATESINPERIOD('Date'[Date],today() ,-2,MONTH))

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series 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

HI @amitchandak 

Thanks for the prompt reply, its very much appreciated.

I definitely have costs in lasty 2 months and i have extended this out to 6 months and 1 year and still blank.

I can't seem to get Datesinperiod working at all for me.

I tried to create a new Calender Table and the only thing in it is Date and then when i use the below I get the following error?

SeanOReilly_0-1688482055109.png

 

Hi @amitchandak 

Thanks again for your help.

 

I got it to work - i was missing the .[date] after chosing the datesinperiod date 

SeanOReilly_0-1688486631678.png

 

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!

December 2024

A Year in Review - December 2024

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