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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous2023
New Member

Index match, calculation with multiple option filter

Hi Team,

 

I am new to Power BI and so far has spent lots of time search relevent answer for my analysis.

I am always an excel users, but due to the size of my new datasets (>1GB), Power BI appear to be a better option.

Okay let me get this straight: I would like to calculate the duration of the activities taking place for each participants, but I only have data of specific milestones of each participants as rows. How should I proceeed?

My table

ParticipantMilestoneDate
1011123Start1989/1/1
1011198start11988/1/1
1011167End2000/2/1
1011123end12002/3/1
1011198end2011/1/1
1011167start1989/1/1
1011123pause1998/1/1

 

My expected results 

ParticipantsStart timeEnd timeDuration
10111231989/1/12002/1/113 year
10111671989/1/12000/1/111 year
10111981988/1/12011/1/1

23 year

 

My thoughts (in excel logic):

1. Create additional column that converts "Start", "start" and "start1" as "start" (and for "end" as well)

2. Indexmatch the time for each participant in start time and end time columns.

3. Calculate the duration.

 

I was stopped at the first step, I can't really create a new table with filter that includes all the "start" related status. (OR and || didnt work unforutnately)

Happy to see how I could proceed, thank you.

3 REPLIES 3
NaveenGandhi
Super User
Super User

Hello @Anonymous2023 

Try the below dax to create a new table.


Milestone_Table =
ADDCOLUMNS (
SUMMARIZE (
'Table (2)',
'Table (2)'[Participant],
"Start_Time",
CALCULATE (
MIN ( 'Table (2)'[Date] ),
'Table (2)'[Milestone] = "start"
|| 'Table (2)'[Milestone] = "Start"
|| 'Table (2)'[Milestone] = "start1"
),
"End_Time",
CALCULATE (
MIN ( 'Table (2)'[Date] ),
'Table (2)'[Milestone] = "end"
|| 'Table (2)'[Milestone] = "End"
|| 'Table (2)'[Milestone] = "end1"
)
),
"Duration", DATEDIFF ( [Start_Time], [End_Time], YEAR )
)

NaveenGandhi_0-1686078423923.png

 


Let me know if you have any questions.

If this post helps, then please consider Accept it as the solution to help the others find it more quickly. Appreciate your kudos!!

Hi Thank you for your answer.
Just a quick follow-up.
In the original dataset, there is some milestone that is before the start date, which means that MIN does not apply. (I did not include that here for simplicity.)
How should I proceed with this situation?
Thank you.

@Anonymous2023 

 

Is that milestone a different category? If yes you can keep aggregating them as seperate columns same as how i have created start time and end time in the above measure.

 

Regards,

Naveen 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors