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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
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.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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