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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
enmnm
New Member

Power Pivot Measure to calculate days between two dates for each category

I hope I am in the correct forum. I have an excel table that I have loaded into my data model. The topic is, say butterflies.

The "Stage" column is a calculated column using an If statement and based on the last isblank cell. What I would like to do is to write a measure that calculates the StageDays based on Stage--which would be today - the last filled-in-date. Can you help me figure out how to do this? Thanks.

 

SpecimenEggDateLarveDatePupeDateStageStageDays
012454/6/20235/7/20236/3/2023Pupe 
03572/4/2023  Egg 
09342/9/20235/6/2023 Larve 
      
      
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

If you want to keep your data in Excel you will have to hard code the order of the column checks.

 

In Power BI we would ask you to unpivot your data, and to provide a reference table with the stage sequence index.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

If you want to keep your data in Excel you will have to hard code the order of the column checks.

 

In Power BI we would ask you to unpivot your data, and to provide a reference table with the stage sequence index.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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