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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply

Time intelligence Function

Hello All! 

 

Im currently trying to write a Dax query to retrive the  "Current Date" for the previous month in a scheduling Report. 

 

 

Each Scheduled acticty has a Baseline date and a current date as seen below what I would like to do is  write a measure to return the "Current Date" from the previous month into a new Column called (Previous Month)   

 

 

Snag_487acf.png

 

 

Thanks for the Help in advance 🙂 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a measure like

Previous Month =
LOOKUPVALUE (
    'Table'[Current Month],
    'Table'[Activity ID], SELECTEDVALUE ( 'Table'[Activity ID] ),
    'Table'[Reporting date], EOMONTH ( SELECTEDVALUE ( 'Table'[Reporting Month] ), -2 ) + 1,
    BLANK ()
)

View solution in original post

6 REPLIES 6

You are the best !!! Thank you so much ❤️

johnt75
Super User
Super User

You could create a measure like

Previous Month =
LOOKUPVALUE (
    'Table'[Current Month],
    'Table'[Activity ID], SELECTEDVALUE ( 'Table'[Activity ID] ),
    'Table'[Reporting date], EOMONTH ( SELECTEDVALUE ( 'Table'[Reporting Month] ), -2 ) + 1,
    BLANK ()
)

Thank you for the fast response @johnt75  it seems to be working but not to the exact level,  I still want to show other Activites if there isnt a Current date in the Previous month the measure seems to filter out the table 

Snag_7f9ce2.png

 

In the fields well, click on the down arrow next to Activity ID and choose "Show items with no data"

One last question the first activity dosent capture the previous months current date for some reason 

 

Snag_87377a.png

Try using Power Query to change the type of the reporting date column to date rather than datetime. Its possible that there are some microseconds, not being displayed, which means the two values don't match

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.