cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
redko_f
Frequent Visitor

Start summing fields after milestone (Date)

Hey guys I'm quite new to Power BI so I have a question. 
I have two tables Calendar and Unit Tracker. 
In the unit tracker I have fields: 
1) DaysIn (Result of calculation of difference betwen IN and OUT) 

2) IN
3) OUT
4) UnitNum
5) WorkshopEnd
6) LastRefurbish (Last date of workshop for Unit)
In the Calendar the main field which I use is Date filtered by latest OUT date and The first IN date.
What I need to do is summrize DaysIN for the Unit from the moment of the LastRefursbish. 
I was tried to use next formula but I receve and error message: 

Annotation 2019-11-06 130736.png
Can somebody tell what is wrong and how I need to change formula.

1 REPLY 1
RaduH
New Member

Hi, as usually in Power BI, there are more ways to achieve the same result>

Prerequisite: please make sure that all dates are formatted as dates: Home->Edit Queries -> Edit Queries - -> Select the columns, right click, Transform -> Data Type: Date.

Alternative 1:

1. Create a Table where you sum days in for each LastRefurbish date.

2. Create a measure which calculates the DaysIn - Last Refurbish:

Simple measure: DATESBETWEEN(<dates>,<start_date>,<end_date>)

More complex / including conditions:

 =CALCULATE(SUM(InternetSales_USD[SalesAmount_USD]), DATESBETWEEN(DateTime[DateKey], 
   
DATE(2007,6,1), 
   
DATE(2007,8,31
  ))

3. Create a relationship between Calendar dates and Last Refurbish and summarize based on Calendar dates.

 

The posted picture is not visible, I hope this helps. If you tweak a bit around the above solutions you will easily get there - I am sure!

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors