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
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.