Earliest Date from the Source Data - DAX Calculation

Hello, I’m looking for assistance with a DAX calculation.

It’s the Dashboard for Project Status. The connection will be a Folder connection, and for each month, I will upload a file. I now have three months’ worth of data that shows the status of each project for each month. The “Connecticut Command - Infrastructure” project, for example, includes status on each source file, such as “Green” in January 2022, “Yellow” in February 2022, and “Red” in March 2022. It also features a Date column (total of 5 columns) for these projects that capture the Baseline Preliminary Date, as well as several additional Baseline Date columns.

Baseline Preliminary Date =
VAR PeriodName =
IF (
HASONEVALUE ( ‘Data Dump’[Project Name] ),
CALCULATE (
MIN ( ‘Data Dump’[Period] ),
ALLEXCEPT ( ‘Data Dump’, ‘Data Dump’[Project Name] )
)
)
VAR ProjectName =
SELECTEDVALUE ( ‘Data Dump’[Project Name] )
VAR V =
CALCULATE (
SELECTEDVALUE ( ‘Data Dump’[Baseline Preliminary Date] ),
ALLEXCEPT ( ‘Data Dump’, ‘Data Dump’[Project Name] ),
KEEPFILTERS (
TREATAS (
{ ( PeriodName, ProjectName ) },
‘Data Dump’[Period],
‘Data Dump’[Project Name]
)
)
)
RETURN
IF ( ISBLANK ( V ), " - ", Format(V,“DD-MM-YYYY”) )

Now that I have a few slicers on the Report page, the above DAX works, but I need to update the code to include the following new logic. I’d like to add another filter (inside the code) with the new criteria being column “Current Macro Phase” NOT Equals Preliminary and provided code.

If a project starts in January but the Current Macro Phase is “Preliminary,” my DAX measure should show the Baseline Date from the next month’s file (Considering the “Current Macro Phase”(Column in Data Set) is been changed in February Data file). If not then it should look for the Source where these criteria meet.

Test Report.pbix (65.1 KB)
Project_Status_GCS, Budget & PMO_05-01-2022.xlsx (100.2 KB)
Project_Status_GCS, Budget & PMO_05-02-2022.xlsx (100.3 KB)
Project_Status_GCS, Budget & PMO_05-03-2022.xlsx (100.2 KB)

Hi @roshan, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

  • Use the forum search to discover if your query has been asked before by another member.
  • When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

image

  • Use the proper category that best describes your topic
  • Provide as much context to a question as possible.
  • Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.

Hi @roshan - Bit confused with the new requirement for “Current Macro Phase” NOT Equals Preliminary and provided code.

As I can see in data for “Current Macro Phase” column, there is no “Preliminary" value present. Also, what you meant by provided code.

Please share with an example for me to look further.

Thanks
Ankit J

Hi @roshan, we’ve noticed that no response has been received from you since May 4th. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved.