Forum Discussion

siros92's avatar
siros92
Frequent Visitor
4 years ago

Help needed with lastnonblank

Hi all, in advance thanks for helping out. 

 

I have a bit of a weird behaviour from lastnonblank which probably is due to my lack of understanding..

I've got two columns that are relevant to my question here one is [Scoring] which contains the score given at a certain date. It only contains data on dates assessments were done. Each row in my dataset represents a date and the column latest score in which I am attempting for powerbi to repeat the latest score for a individual. 

As you can see from the first picture i get lastnonblank to repeat the result as long as the next grade is higher than the first. if the next grade is lower as in this example it just ignores it completely. the previous grade to the one i've shown is 3 which should be showing until there is a new grade in the [Scoring] column.  I've also added a picture of the DAX. 

 

Help would be very much appreciated. 

Just to be clear, the result im looking for is for power bi to repeat whatever the last value in column [score] was based on the date. 

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    siros92 Second parameter of LASTNONBLANK should be calculated expression, not just interger. In your case second parameter doesn't give any blank values, there always result equals 1 and LASTNONBLANK doesn't retrieve any value from [Scoring] column.

    • siros92's avatar
      siros92
      Frequent Visitor

      Thanks Marik, any suggestions as to how to make the calculated expression?

      Cheers, 

      • Anonymous's avatar
        Anonymous
        Not applicable

        There is lack of details to make some suggestion.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi siros92 ,

     

    What is the expected result of the screenshot you shared above?

    And what are [Globalweek] and [Site Nr] in your table?

    Please show some sample data if you need DAX help.

     

    Best Regards,

    Jay