Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Brett007
Helper III
Helper III

Filtering a Calculated column to only show the Latest Date result.

I am using this column in a matrix that is built off data from an associated table (connected via Program Number) 

The problem is my filter does not work.  It shows all dates rather than just the latest Approved date for the review.  I would like it to be a Blank cell if it is not the latest Approved.  I do not want the Matrix to only show the values that exsist.  I want to see the blank rows as well.  That is why I want to use a column. 

Latest Approved Review =
--If the Date Approved is the Latest date for that Program Number then  Return the Date Approved and a similar calculated column for the associated Review in a matrix.

CALCULATE(
LASTDATE(Reviews[Date Approved]),
FILTER(All(Reviews[Program Number]),Reviews[Program Number] = Earlier(Reviews[Program Number])))

Sample dataset:
Troubleshooting PBI 
2 ACCEPTED SOLUTIONS
selimovd
Super User
Super User

Hey @Brett007 ,

 

check the following calculated column. With that you will get the latest [Date Approved] by [Program Number]:

Latest Approved Review NEW =
VAR vProgramNumber = Reviews[Program Number]
RETURN
    CALCULATE(
        MAX( Reviews[Date Approved] ),
        Reviews[Program Number] = vProgramNumber,
        ALLEXCEPT(
            Reviews,
            Reviews[Program Number]
        )
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

View solution in original post

@Brett007 

Same approach, you save the date of the current row in a variable (like the program number) and then get the MAX from the table that is filtered to the desired date 

View solution in original post

4 REPLIES 4
selimovd
Super User
Super User

Hey @Brett007 ,

 

check the following calculated column. With that you will get the latest [Date Approved] by [Program Number]:

Latest Approved Review NEW =
VAR vProgramNumber = Reviews[Program Number]
RETURN
    CALCULATE(
        MAX( Reviews[Date Approved] ),
        Reviews[Program Number] = vProgramNumber,
        ALLEXCEPT(
            Reviews,
            Reviews[Program Number]
        )
    )

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

 

If I wanted to use a similar formula to pull in the 'Review' that corrisponds to the date, how would I do that.  I tried to manipulate the current formula, but I think the Max() is what I'm getting stuck on.  Thanks.

@Brett007 

Same approach, you save the date of the current row in a variable (like the program number) and then get the MAX from the table that is filtered to the desired date 

Thank you.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.