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
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 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Kudoed Authors