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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
AnthonyJoseph
Resolver III
Resolver III

Add a column check if the project existed last year

Hi Community,

 

I have a dataset similar to the below, I need to create a column which can return True if the same combination of portfolio and project has existed (could be either active/yet to start/completed) last year, if not it should return false. I am not sure if this is achieveable in power query-please can someone help me on this.

AnthonyJoseph_0-1679941705701.png

Thanks,

AnthonyJoseph

 

1 REPLY 1
BA_Pete
Super User
Super User

Hi AnthonyJoseph,

 

Group your table on [Portfolio] and [Project].

In the Group By dialog, add one aggregation column that uses the 'Count Rows' operator.

Add another that uses the 'All Rows' operator.

Exit the Group By dialog and add a new custom column like this:

if [countColumn] > 1 then "TRUE" else "FALSE"

Now expand your 'All Rows' column back out again to reinstate your original table.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors