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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rokacl
Helper I
Helper I

Dax : Track Progress in a Chain of Activities

Hi There,

 

I have a process that need to be followed step by step, just to be sure that everyone is doing their stuff in time, so I have a table with the steps and the days to have the thing done. So I want to be able to show the actual step, and the one that is coming.

 

Here the example:

Actual EventDays To Make ItResponsible
Writte the Letter3Ann
Code the Letter1Peter
Send the Letter2Mike

 

So I need a way to create a Column that will be displaying the next step, in relation with the actual phase, 

 

Here the example:

Actual EventDays To Make ItResponsibleNext Step
Writte the Letter3AnnCode the Letter
Code the Letter1PeterSend the Letter
Send the Letter2Mike-

 

I have like 24 events, so a nested IF sounds like a dummy solution,

 

Any ideas?

 

Thanks

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @rokacl ,

 

You can create an index column wrt to the steps.

 

1.jpg

 

 

 

Then use the measure

 

Next Event =

var _a = MAX('Table'[Index Column])

RETURN
CALCULATE(MIN('Table'[Actual Event]), FILTER(ALL('Table'),'Table'[Index Column] = _a+1))
 
2.JPG
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

View solution in original post

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

hi  @rokacl 

First, you need define a sort number for event in a dim event and create a relationship with data table

1.JPG

Then in data table, create a new column as below:

Next Step = CALCULATE(MAX('Dim Event'[Actual Event]),FILTER(ALL('Dim Event'),CALCULATE(MAX('Dim Event'[Sort No]))=RELATED('Dim Event'[Sort No])+1))

Result:

2.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
harshnathani
Community Champion
Community Champion

Hi @rokacl ,

 

You can create an index column wrt to the steps.

 

1.jpg

 

 

 

Then use the measure

 

Next Event =

var _a = MAX('Table'[Index Column])

RETURN
CALCULATE(MIN('Table'[Actual Event]), FILTER(ALL('Table'),'Table'[Index Column] = _a+1))
 
2.JPG
 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

 

Thank you very much, I used the switch just to go on, but this was the kind of solution I was thinking of, I´m gonna try it today,

 

Have a nice day!

amitchandak
Super User
Super User

@rokacl , Do you have some mater for Event order? Looking at this we can only hard code event order. What we need is an event order table. We can put that into this table using related or lookupvalue.

 

And if they are non-continuous we can use rank to make them continuous

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...

 

 

 

Greg_Deckler
Super User
Super User

Right, @rokacl you want a SWITCH or SWITCH(TRUE()...) statement. Unless you have some table of the steps in order with the next and previous steps in them and then you could use LOOKUPVALUE.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.