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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.