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

2nd row value in 1st row

Hi All,

 

I m fresh to BI, I have a problem with delta calculation from a column.

I have a maeasure to calculate the count for every rank.

Can some one help to calculate the delta from next row score.

 

Thanks in advance 

RankCountScoreDelta
1241624476(=244-168) 
2187016843
3182612523
4166710221
516098152
61080298
793921 
1 ACCEPTED SOLUTION

@KiranGupta15, you may want to adjust the measurement this way

Delta = 
VAR __next_rank = MAX ( 'Table'[Rank] ) + 1
VAR __next_score =
    CALCULATE (
        [Score],
        'Table'[Rank] = __next_rank,
        ALL ( 'Table' )
    )
RETURN
    IF ( NOT ISBLANK ( __next_score ), [Score] - __next_score )

View solution in original post

4 REPLIES 4
Community Support
Community Support

Hi @KiranGupta15 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

Super User III
Super User III

Hi, @KiranGupta15 , you might try this measure

Delta = 
VAR __next_rank = MAX ( 'Table'[Rank] ) + 1
VAR __next_score =
    CALCULATE (
        MAX ( 'Table'[Score] ),
        'Table'[Rank] = __next_rank,
        ALL ( 'Table' )
    )
RETURN
    IF ( NOT ISBLANK ( __next_score ), MAX ( 'Table'[Score] ) - __next_score )

Thanks sir....

My "Score"  is a Measure, not a column in table.

 

"Column 'Score' in table 'Table' cannot be found or may not be used in this expression."

This is the error message ...:

@KiranGupta15, you may want to adjust the measurement this way

Delta = 
VAR __next_rank = MAX ( 'Table'[Rank] ) + 1
VAR __next_score =
    CALCULATE (
        [Score],
        'Table'[Rank] = __next_rank,
        ALL ( 'Table' )
    )
RETURN
    IF ( NOT ISBLANK ( __next_score ), [Score] - __next_score )

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors