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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mweber87
Helper I
Helper I

Different start and end dates

I have a data set where there are multiple job_id's (5079) each job, which is labeled as job_id starts and stops on different dates. I want to create a column that shows the start week as 1 and the last week as the last number for each job. The duration of the job is tracked by transaction_amount. I tried this: (but it does a running total and does not seperate it by job_id)

Week Running Total by Job_Id =
VAR CurrentDate = d[transaction_date]
VAR CurrentJobTable =
    CALCULATETABLE ( d, ALLEXCEPT ( d, d[Job_Id] ) )
VAR Filtered =
    FILTER ( d, d[Transaction_date] <= CurrentDate )
RETURN
    COUNTX(Filtered, d[transaction_amount] )

 

Here is a snip of data to reference:

mweber87_0-1667929428365.png

 

3 REPLIES 3
seenavinu
Regular Visitor

I have a table with multiple flight numbers with a start date. But now I want to add different start and end dates for each of these flights (screenshot below). How do I add these columns so that only those dates that is specified for each flight will be reflected in my power bi dashboard? 

Appreciate experts support on this.

 

seenavinu_0-1692700422041.png

 

@seenavinu 

it's better to open a new post, then more people can read and help you.

What's the expected output for your sample data?

What's the calculation logic?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@mweber87 

is this what you want?

yearweek = year('Table'[start date])*100+WEEKNUM('Table'[start date])

Column = CALCULATE(DISTINCTCOUNT('Table'[yearweek]),FILTER('Table','Table'[job id]=EARLIER('Table'[job id])&&'Table'[yearweek]<=EARLIER('Table'[yearweek])))

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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