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
g_js
Regular Visitor

Find if the data was converted in data with past date

Hi,
I am tring to get to a solution where i am able to know if the data was converted from A to C 

Date               Column 1               Column 2
1/1/2021           123                             A

2/1/2021           123                             B
3/1/2021           123                             C
4/1/2021            123                            D
12/1/2021          456                            A
12/2/2021          456                            C

1/1/2021            789                            E

2/1/2021            789                            B
3/1/2021            789                            C
4/1/2021            789                            D


I ind to out for a particular value of column 1 Column2 value is C but was A in the past. so basically 3 and 6 line will be tue
May be create a new column with that formulas.

Thanks and Regards,
Gagan




1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @g_js ,

Here are the steps you can follow:

1. Create calculated column.

rank =
RANKX(FILTER(ALL('Table'),[Column1]=EARLIER([Column1])),[Date],,ASC,Dense)
New Column =
IF(
    [Column2]="A",
    IF(
        "C" in SELECTCOLUMNS(FILTER('Table',[rank]>EARLIER([rank])&&[Column1]=EARLIER([Column1])),"1",[Column2]),
        "C",
        [Column2]),
        [Column2])

2. Result:

v-yangliu-msft_0-1614936016519.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @g_js ,

Here are the steps you can follow:

1. Create calculated column.

rank =
RANKX(FILTER(ALL('Table'),[Column1]=EARLIER([Column1])),[Date],,ASC,Dense)
New Column =
IF(
    [Column2]="A",
    IF(
        "C" in SELECTCOLUMNS(FILTER('Table',[rank]>EARLIER([rank])&&[Column1]=EARLIER([Column1])),"1",[Column2]),
        "C",
        [Column2]),
        [Column2])

2. Result:

v-yangliu-msft_0-1614936016519.png

You can downloaded PBIX file from here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@g_js , A new column will give true or false

 

new column =
var _1 = countx(filter(Table, [Column 1] =earlier([Column 1]) && [Date] <earlier([Date]) && [Column 2] ="A"),[Column 1])
return
if([Column 2] = "C" && not(Isblank(_1)), true(), false())

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

December 2024

A Year in Review - December 2024

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