cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nisuomi Regular Visitor
Regular Visitor

Compare to previous row on Table

Hi,

 

Is there any way, that I could compare the data between the rows in Power BI table?

prev.png

 

For example I would like to check if the column named Joukkue is having a same name on the next row than in the previous.

On the image, you can see that the two first one are the same.

 

In QlikView, there is easy method to do this with the set analysis.

I am not so familiar with the DAX, but can't find any easy solution out of the box to this... If any ideas, please share 🙂 Thank you!

 

 

 

Cheers,

Niko

3 REPLIES 3
Community Support Team
Community Support Team

Re: Compare to previous row on Table

Hi @nisuomi,

 

Actually, power bi not contains column index and row index. For your scenario, you need to add an index column to compare with different rows.

Then you can use index and index-1 to find out correspond records and previous record, compare these records to get result which you wanted.

 

If you need some specific help about dax formula, you can provide some sample data to test.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
nisuomi Regular Visitor
Regular Visitor

Re: Compare to previous row on Table

Hello @v-shex-msft,

 

Well that is a bummer, that the Power BI can't (or won't) index the rows automatically if I create a table - that would be (too) handy.

I can't understand if I add a manual index, can I use the same index to check on every different tables with the same index the situation, that we have a repeated teams?

 

And other thing as well, how can I get a constant min date over all dates?

I can get a min date with a filter, but when I put it to the table it shows the min for all of the relative dates - it should show the min for all the rows - any idea how can this be achieved?

 

The calculation is

seuraava_ottelupv = CALCULATE(MIN(Otteluohjelma[pvm]);isblank(Otteluohjelma[ratkaisu]))

 

I can attach the workbook here as an attachment as well.

nimetön.png

 

It is just a public available stats from Finnish Hockey League website 🙂

http://www.liiga.fi

 

 

EDIT: How can I add an attachment... 

EDIT2: Aparrently you can't, so here is a external link: https://www.dropbox.com/s/xnq9jn1auqhyn4z/pisteet.pbix?dl=0

 

 

 

Cheers,

Niko

Community Support Team
Community Support Team

Re: Compare to previous row on Table

HI @nisuomi,

 

I think I'm stuck on your tables.(it is hard to analyse the effective column who used to calculate as index)

In my opinion, my suggest is create new index table with 'Nimi' column and index, then find out 'Nimi' from current content, lookup above index table to find out previous/next one, compare these records.

 

Notice: if your data contains any privacy data, please do mask sensitive data before sharing.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

Helpful resources

Announcements
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors