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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
giuliapiazza94
Helper IV
Helper IV

Date between two dates

Hi guys,

I have two tables + 1 calendar table.

When I choose a date in a calendar table I need to know how much each one pays.

 

For example, if I select 25/06/2022, D pays 400/30*25 on June.

I don't know how link calendar table anche the first table (on the left)

 

 

Immagine 2021-05-28 102010.jpg

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @giuliapiazza94 

Please check the below picture and the sample pbix file's link down below.

 

Picture3.png

 

Payment Amount Measure =
VAR startdateofmonth =
EOMONTH ( MAX ( Dates[Date] ), -1 ) + 1
VAR currentdate =
MAX ( Dates[Date] )
VAR howmanydays =
DATEDIFF ( startdateofmonth, currentdate, DAY ) + 1
VAR dayscountcurrentmonth =
CALCULATE (
COUNTROWS ( Dates ),
FILTER ( ALL ( Dates ), Dates[Month & Year] = MAX ( Dates[Month & Year] ) )
)
RETURN
CALCULATE (
( SUM ( Amount[Amount] ) / dayscountcurrentmonth ) * howmanydays,
FILTER (
IDs,
MIN ( Dates[Date] ) <= IDs[EndDate]
&& MAX ( Dates[Date] ) >= IDs[StartDate]
)
)

 

 

https://www.dropbox.com/s/9i3n40raxmg371o/giuliapiazz.pbix?dl=0 

 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

you are a genius, Thank you!I have another question:

how can I compare a date with a slicer date?

For exampe I have

 

Date 1 - 01/01/2023
Date 2 - 09/22/2021

Date 3 - 25/4/2020

 

Slicer date fixed on 03/06/2021 (calendar table)

 

If I wanted to write If(Calendar[Date] >date 2, etc etc)

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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