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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yellow43
Helper I
Helper I

Create new colum comparing value in same column

Hi Community,

 

Probably this is easy to solve, but I am having some problems.

I would like to cretae a new column with this conditions:

- between dates 1/1/2023 and 31/3/2023

- check if value is the same in the column

- create new column if value is the same in the column and if it was created  between dates above. 

 

Here is the result expected for new column [New2023?]:

 

2023-07-10_12h44_50.png

Product=Pasta is the one that is in different rows and that match conditions above.

Can you help me?

Thank you. 

 

1 REPLY 1
AlanFredes
Resolver IV
Resolver IV

Hi Yellow,

 

A calculated column that evaluates if the Product value is duplicated and within the data range you need would work.
Something like the bellow code:

New 2023 =
VAR Current_Val = 'Data table'[Product]
VAR Start_Date = DATE(2023,1,1)
VAR End_Date = DATE(2023,3,31)
VAR Duplicate =
    COUNTROWS(
        FILTER(
            'Data table',
            'Data table'[Product]=Current_Val
        )
    )
VAR Check_Date = IF('Data table'[Created at]>=Start_Date && 'Data table'[Created at]<=End_Date,1,0)
RETURN
IF(Duplicate=2 && Check_Date=1,1,0)

AlanFredes_0-1689002584987.png

 


You can find the example in this file: Create new colum comparing value in same column.pbix

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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