Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Need Measure for getting the max date

Hello Everyone,

I am working on a project where I need some help. So if you something do let me know.

I have the 2 tables with me, the Unit and date table
Unit table->unit id,sub-unit, name
Date table-> activity, date, unit ID

Both are connected with unit id to each other 
output:-
In power bi in table visual, I am showing the below details 
date ->date table
activity->date table
unit ->Unit table
sub-unit->unit table

I want to write a measure where I can get the Max date from each sub-unit same as the output column in the above image.

If anyone knows how to do it please let me know.

  • Anonymous 
    Measure = CALCULATE(MAX(date[date]),ALLEXCEPT(unittable,unittable(sub unit)))
     
    If this post helps, please consider accept as solution to help other members find it more quickly.
  • Hi,

    you can try

    Column = IF('Table'[Date]=CALCULATE(LASTDATE('Table'[Date]),ALLEXCEPT('Table','Table'[SubUnit])),CALCULATE(LASTDATE('Table'[Date]),ALLEXCEPT('Table','Table'[SubUnit])),BLANK())
     
    If this post is useful to help you to solve your issue consider giving the post a thumbs up and accepting it as a solution !

2 Replies

  • Anonymous 
    Measure = CALCULATE(MAX(date[date]),ALLEXCEPT(unittable,unittable(sub unit)))
     
    If this post helps, please consider accept as solution to help other members find it more quickly.
  • Hi,

    you can try

    Column = IF('Table'[Date]=CALCULATE(LASTDATE('Table'[Date]),ALLEXCEPT('Table','Table'[SubUnit])),CALCULATE(LASTDATE('Table'[Date]),ALLEXCEPT('Table','Table'[SubUnit])),BLANK())
     
    If this post is useful to help you to solve your issue consider giving the post a thumbs up and accepting it as a solution !