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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

How do I show the last stage

Hello All,

Pleaseeee!!! I need help from the gurus in Power BI community.

I am trying to show only the last stage in a table visual and not the other previous stages.

I have tried to use Max date and lastnonblank but it's not workin. Attched is a screen shot of the table and the last activity I would like to get is marker in red 8-Final Mech.

Thanks!!STAGES_.png

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Dont know whether the number at the left-most in ranking in order,if so,take below steps:

1.create a column  as below:

_number = LEFT('Table'[Stage],1)

2.create a measure as below:

Last activity = 
var _maxnumber=MAXX(FILTER(ALL('Table'),'Table'[Date] in FILTERS('calendar table'[Date])),'Table'[_number])
Return
CALCULATE(MAX('Table'[Stage]),FILTER('Table','Table'[Date] in FILTERS('calendar table'[Date])&&'Table'[_number]=_maxnumber&&'Table'[Stage]<>BLANK()))

And you will see:

v-kelly-msft_0-1617871486185.png

If the number order is disordered,then first create an index column;

Then create a measure as below:

Last activity = 
var _maxnumber=MAXX(FILTER(ALL('Table'),'Table'[Date] in FILTERS('calendar table'[Date])),'Table'[_number])
Return
CALCULATE(MAX('Table'[Stage]),FILTER('Table','Table'[Date] in FILTERS('calendar table'[Date])&&'Table'[_number]=_maxnumber&&'Table'[Stage]<>BLANK()))

And you will see:

v-kelly-msft_1-1617871919491.png

For the related .pbix file ,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 


 

View solution in original post

5 REPLIES 5
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

Please correct me if I wrongly understood your question.

I am not sure how to suggest without seeing your DAX measure, but please try to write something like below.

 

measures = calculate ( max(your measure to find the stage), allselected (your table[House Number]))

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Anonymous
Not applicable

Thanks Jihwan,

this is the measure I tried


2.LAST ACTIVITY =
VAR SELECTEDDATE=MAX('CONSTRUCTION SCHEDULE'[FINISH DATE])
VAR CURRENTSTATUS =MAX('CONSTRUCTION SCHEDULE'[CURRENT STAGE])
RETURN
IF(CURRENTSTATUS == BLANK() || CURRENTSTATUS = "",
VAR LATESTSTATUSDATE =
CALCULATE(
MAX('CONSTRUCTION SCHEDULE'[FINISH DATE]),
'CONSTRUCTION SCHEDULE'[FINISH DATE]<SELECTEDDATE,
'CONSTRUCTION SCHEDULE'[CURRENT STAGE]<> BLANK()
)
RETURN
CALCULATE(
MAX('CONSTRUCTION SCHEDULE'[STAGES]),
'CONSTRUCTION SCHEDULE'[FINISH DATE]=CURRENTSTATUS
),
CURRENTSTATUS
)


This is what it is giving me when I filter (9-Lock Out) which is totally wrong 
instead of showing the last stages dynamically for each house number please see attachement
This is the correct one below it should show 8-Final Mech when filtered and when unfiltered by house number it should last stage for all house number.

 

I appreciate you taking time out to help me!

Anonymous
Not applicable

Screenshot 2021-04-06 121604.png_.png

 

 

 

 

The above is what it is showing which is wrong

Hi @Anonymous ,

 

Dont know whether the number at the left-most in ranking in order,if so,take below steps:

1.create a column  as below:

_number = LEFT('Table'[Stage],1)

2.create a measure as below:

Last activity = 
var _maxnumber=MAXX(FILTER(ALL('Table'),'Table'[Date] in FILTERS('calendar table'[Date])),'Table'[_number])
Return
CALCULATE(MAX('Table'[Stage]),FILTER('Table','Table'[Date] in FILTERS('calendar table'[Date])&&'Table'[_number]=_maxnumber&&'Table'[Stage]<>BLANK()))

And you will see:

v-kelly-msft_0-1617871486185.png

If the number order is disordered,then first create an index column;

Then create a measure as below:

Last activity = 
var _maxnumber=MAXX(FILTER(ALL('Table'),'Table'[Date] in FILTERS('calendar table'[Date])),'Table'[_number])
Return
CALCULATE(MAX('Table'[Stage]),FILTER('Table','Table'[Date] in FILTERS('calendar table'[Date])&&'Table'[_number]=_maxnumber&&'Table'[Stage]<>BLANK()))

And you will see:

v-kelly-msft_1-1617871919491.png

For the related .pbix file ,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 


 

Anonymous
Not applicable

Awesome! Kelly thanks for your help appreciate it !!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.