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

How to retrieve the data of a higher occurrence

Hi, 

 

MarcoCast_0-1673260909174.png

 

I have Column A and Column B with two references.

Columns A and B talk about the same thing.


Column A is the current reference.
Column B is the previous reference of column A.

Column C gives the date of reference A.


I am looking to have a column D which gives the date of the reference B based on column C.

 

An example of what I have in mind:

MarcoCast_1-1673261317904.png

 

Thanks ! 

 

Can you help me please ?

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

Hi , @MarcoCast 

Here are the steps you can refer to :
(1)We can click "Custom Column" and enter this:

(x)=> if List.IsEmpty( Table.SelectRows(#"Changed Type",(y)=> y[A]=x[B])[C] ) then null else
Table.SelectRows(#"Changed Type",(y)=> y[A]=x[B])[C]{0}

vyueyunzhmsft_0-1673318369155.png

(2)Then we can meet your need:

vyueyunzhmsft_1-1673318382009.png

Second, you need to delete the "each" if it exist !

vyueyunzhmsft_2-1673318439105.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
MarcoCast
Regular Visitor

Hi @v-yueyunzh-msft ,

 

Thanks for you time and for help, It work perfectly ! 

I don't clearly understand the command but i will delve deeper into the subject.

 

MarcoCast_0-1673339903004.png

 

If anyone passes by looking for similar help, maybe we can add that in the command, #"Changed Type" refers to the previous query and must be changed depending on our processing.

 

(x)=> if List.IsEmpty( Table.SelectRows(#"Changed Type",(y)=> y[A]=x[B])[C] ) then null else
Table.SelectRows(#"Changed Type",(y)=> y[A]=x[B])[C]{0}

 

Best Regards,

 

Marco

 

 

 

Hi , @MarcoCast 

Yes , the #"Changed Type" refers to the previous query . You can use other step who has the [A],[B],[C] columns also ,and you can also create a fixed name to solve this problem.

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

v-yueyunzh-msft
Community Support
Community Support

Hi , @MarcoCast 

Here are the steps you can refer to :
(1)We can click "Custom Column" and enter this:

(x)=> if List.IsEmpty( Table.SelectRows(#"Changed Type",(y)=> y[A]=x[B])[C] ) then null else
Table.SelectRows(#"Changed Type",(y)=> y[A]=x[B])[C]{0}

vyueyunzhmsft_0-1673318369155.png

(2)Then we can meet your need:

vyueyunzhmsft_1-1673318382009.png

Second, you need to delete the "each" if it exist !

vyueyunzhmsft_2-1673318439105.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

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.