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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Rothbardian
Employee
Employee

Creating a measure to return the date after a given date

How do I create a measure or created column identifying the first date occurring in a table after a given critical date?

 

Scenario

Our team assumed responsibility for a large, active body of content and needs to identify when a given article came into scope for us (was published after the date we assumed responsibility). The table is pulled daily from an Azure DevOps (ADO) analytics view, so all dates of interest exist in the table.

 

Issue

I need to calculate this from the given table:

 

WorkItemIDCreatedPublishedChangedInScopeDateCurrent
11875145634475/19/20201/12/20211/12/2021Jul-201/12/2021TRUE
11891245639395/22/202012/10/20201/5/2021Aug-2012/10/2020FALSE
11891245639395/22/202012/29/20201/5/2021Aug-2012/29/2020FALSE
11891245639395/22/20201/5/20211/5/2021Aug-201/12/2021TRUE
11906845643865/27/20201/12/20211/12/2021Not in scope1/12/2021TRUE
11957945660556/5/20201/8/20211/11/2021Jan-211/12/2021TRUE
12039445700706/26/20206/26/20201/11/2021Not in scope1/12/2021TRUE
12054045704856/30/202012/24/202012/27/2020Not in scope1/12/2021TRUE
12092045729287/9/20207/10/20201/11/2021Jul-201/12/2021TRUE

 

I have tried to extrapolate fromDAX Formula to Return First Date Based on Other column , but am not able to successfully incorporate the conditional clause. The furthest I've gotten on that front is to replicate the "Created" column, which doesn't meet my need.

I think I am on the right track with this conditional column formula:


InScope =
VAR DateFilter = FILTER(PubTable,PubTable[Published]>DATEVALUE(7/1/2020))
VAR FirstPub = CALCULATE(
    FIRSTDATE(PubTable[Published]),
    DateFilter,
    ALLEXCEPT('PubTable','PubTable'[Published]
    )
RETURN FirstPub


Thanks in advance for any insight you can provide!

1 ACCEPTED SOLUTION
Rothbardian
Employee
Employee

UPDATE: I was able to derive the information I needed through a combination of filters on the Published field and Earliest calculation on the visual values. 

  • Visual filter: Published is on or after 7/1/2020
  • Visual Values field: Earliest(Count (Distinct) of WorkItemID)

This resulted in a matrix counting first publication of articles after the critical date. 

 

Article publication count.png

 

I manually confirmed that each article listed was unique and that the listed publication date was the first after the critical date.

View solution in original post

3 REPLIES 3
Rothbardian
Employee
Employee

UPDATE: I was able to derive the information I needed through a combination of filters on the Published field and Earliest calculation on the visual values. 

  • Visual filter: Published is on or after 7/1/2020
  • Visual Values field: Earliest(Count (Distinct) of WorkItemID)

This resulted in a matrix counting first publication of articles after the critical date. 

 

Article publication count.png

 

I manually confirmed that each article listed was unique and that the listed publication date was the first after the critical date.

Ashish_Mathur
Super User
Super User

Hi,

Please share the logic behind generating the dates in the InScope column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

The logic is very straightforward:

  • The InScope date is the first (earliest) date of publication (from Published column) on or after July 1, 2020. The table is refreshed daily from an ADO analytics view.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.