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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
alice11987
Helper I
Helper I

Flag the first occurrence of Table Name in each Environment

Hi, I would like to create an additional column to flag the first occurence of duplicate Table Name in each Environment as below:

 

alice11987_0-1697524533800.png

say table name ABC appeared first in 1 Jan 2023 in DEV env, it should be flagged "1"

and this table can appear again in UAT env, it should be flagged as "1" again in its first appeared in UAT env.

 

how should I do it, either in DAX or PQuery?

 

thank you

1 ACCEPTED SOLUTION
dk_dk
Super User
Super User

Hi, @alice11987 

I have a solution with DAX Calculated Column:

Flag = 

VAR ename = Example[ENV]
VAR tname = Example[TABLE]
VAR firstocc = CALCULATE(MIN(Example[CREATED]),ALL(),Example[ENV]=ename,Example[TABLE]=tname)
RETURN
IF(Example[CREATED]=firstocc,1,0)

 
my results:

dk_dk_0-1697529431328.png

Hope this helps 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
dk_dk
Super User
Super User

Hi, @alice11987 

I have a solution with DAX Calculated Column:

Flag = 

VAR ename = Example[ENV]
VAR tname = Example[TABLE]
VAR firstocc = CALCULATE(MIN(Example[CREATED]),ALL(),Example[ENV]=ename,Example[TABLE]=tname)
RETURN
IF(Example[CREATED]=firstocc,1,0)

 
my results:

dk_dk_0-1697529431328.png

Hope this helps 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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