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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
AllanBerces
Post Partisan
Post Partisan

Hour Distribution from Current Date to Max Plan Date

Hi Good day,

Can anyone pls need help and assistance on my data. I want to add the increase of hour on my plan from current date to max date of my plan, the tricky part its keep on changing almost everyday.

So let say base the table below my base hrs is 565hrs and increase to 856hrs(become new base) the difference to be equally distributed each date to max date. 

If on the following day increase let say 900hrs - 856 = 44 to be distribute. 

The main goal is if there an increase of hours should equal to my total(new base).

AllanBerces_0-1708687854240.png

my measure

AllanBerces_1-1708688192188.png

Thank you in advance

1 ACCEPTED SOLUTION
v-jingzhan-msft
Community Support
Community Support

Hi @AllanBerces 

 

You can try the following column. Is this what you want?

Column = 
VAR newHours = 856
VAR BaseHours = 565
VAR maxDate = CALCULATE(MAX('Table'[Date]),ALL('Table'))
VAR days = DATEDIFF(TODAY(),maxDate,DAY) + 1
RETURN
IF('Table'[Date]>=TODAY(),
    DIVIDE(newHours-BaseHours,days))

vjingzhanmsft_0-1708941694622.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

4 REPLIES 4
v-jingzhan-msft
Community Support
Community Support

Hi @AllanBerces 

 

You can try the following column. Is this what you want?

Column = 
VAR newHours = 856
VAR BaseHours = 565
VAR maxDate = CALCULATE(MAX('Table'[Date]),ALL('Table'))
VAR days = DATEDIFF(TODAY(),maxDate,DAY) + 1
RETURN
IF('Table'[Date]>=TODAY(),
    DIVIDE(newHours-BaseHours,days))

vjingzhanmsft_0-1708941694622.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Greg_Deckler
Super User
Super User

@AllanBerces Maybe:

Measure = 
  VAR __New = [New Hrs]
  VAR __Base = [Base Hrs]
  VAR __Diff = __New - __Base
  VAR __Today = TODAY()
  VAR __MaxDate = MAX('Table'[Date])
  VAR __Table = FILTER(ALL('Table'), [Date] >= __Today && [Date] <= __MaxDate)
  VAR __Count = COUNTROWS(__Table)
  VAR __Result = DIVIDE( __Diff, __Count, 0 )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

here the ouput.

AllanBerces_0-1708694145500.png

 

Hi Greg_Deckler,

Thank you for your respond, but the result are cumulative and reverse order, different from what i required to distribute the hour equally. from today to max date.

 

Pls need some help.

 

Thank you in advance.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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