cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Rothbardian
Microsoft
Microsoft

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
Microsoft

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
Microsoft

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors