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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

date evaluation

Hi everyone I have a problem with a date evaluation.

 

Starting position:

List 1: Calendar

DateWorking day
01.01.2020True
02.01.2020True
03.01.2020True
04.01.2020True
05.01.2020False
06.01.2020False

 

List 2: Construction program

Name

StartEndValue

A

01.01.202003.01.202050
B03.01.202005.01.202060
C02.01.202006.01.202030
D

04.01.2020

06.01.202010

 

Goal:

DateValuecalculation only example
01.01.202016.66(A/3)
02.01.202026.66(A/3 + C/3)
03.01.202056.66(A/3 + C/3 + B/2)
04.01.202050(B/2 + C/3 + D/1)
05.01.20200 
06.01.20200 

What is the best way to do this?

 

I've tried several ways, but don't understand how best to get the results. The first attempt was with the formula:

 

 

 

List.Dates([VorgangGeplanterAnfangsTermin],Duration.Days(
[VorgangGeplanterEndTermin]-[VorgangGeplanterAnfangsTermin])+1,#duration(1,0,0,0))

 

 

 

Then I expanded the list that resulted from it, but so i get several lines per component, which is not a good idea.
can I also work with the list without expanding it?
and how can i then take the calendar into account in a measure?

 

Or do I have to work better with a measure:

DATESBETWEEN(<dates>,<start_date>,<end_date>)

 

Maybe can @ibarrau  help me?
you helped me a lot last time, unfortunately my dashboard has become more complex and this solution is no longer sufficient

 

Thanks a lot

T

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , Based on what I got. I have  similar problems

see if this can help

https://www.dropbox.com/s/o2v5ekfiw5057do/Working%20date%20between%20Dates.pbix?dl=0

 

or

 

https://www.dropbox.com/s/bqbei7b8qbq5xez/leavebetweendates.pbix?dl=0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Greg_Deckler
Community Champion
Community Champion

@Anonymous Seems like:

Measure = 
  VAR __Date = MAX('Calendar'[Date])
RETURN
  SUMX(FILTER('Table',[Start]>=__Date && [End]<=__Date),[Value])

But I don't understand your / portion of your formula where those numbers are coming from. 



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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

wow, thanks for the quick answer!
sorry i forgot to explain this part:
the values are total and must be distributed over the individual working days
That is the reason that on 01.01.2020 only a third of A
i have applied your measure but its empty, what did i do wrong?
 
Datum.PNG

@Anonymous My bad, should have been:

Measure = 
  VAR __Date = MAX('Calendar'[Date])
RETURN
  SUMX(FILTER('Table',[Start]>=__Date && __Date<=[End]),[Value])


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

hi @Greg_Deckler 

thanks again for the answer
unfortunately the result is not correct
the value is a total value and i have to know the values of the individual days, so the value should be divided by the number of working days

so the results have to be:

Date            Value   explanation of the calculation

01.01.2020  16.66   (The Value of A divided by 3 because its 3 Working Days): 50/3 = 16.66

02.01.2020  26.66   (A divided by 3 and C divided by 3):                                     50/3 + 30/3 = 26.66

03.01.2020  56.66   (A divided by 3 and B divided by 2 and C divided by 3):      50/3 + 60/2 + 30/3 = 56.66

04.01.2020  50        (B divided by 2 and C divided by 3 and D divided by 1):      60/2 + 30/3 + 10/1 = 50

05.01.2020  0          (No Working Day)

06.01.2020  0          (No Working Day)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

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

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.