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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Rothbardian
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.