Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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)
Hi, @giuliapiazza94
Please check the below picture and the sample pbix file's link down below.
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
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)
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |