Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have 1 table contains 2 different date column and one amount column. I want to create a measure to calculate the sum of amount for both date column's date before selected date.
Let's see the example below:
For I want to sum up the amount for both date column less than the select datetime (using slicer created by calendar table to select date):
Solved! Go to Solution.
Hi @winnieymh - try something like this:
Measure1 =
VAR __Dt =
SELECTEDVALUE ( [Date from Slicer] )
RETURN
CALCULATE ( SUM ( Record[Amount] ), Calendar[Date] < __Dt )
+ CALCULATE (
SUM ( Record[Amount] ),
Calendar[Date] < __Dt,
USERELATIONSHIP ( Record[Date2], Calendar[Date] )
)
Hope this helps
David
Hi @winnieymh - try something like this:
Measure1 =
VAR __Dt =
SELECTEDVALUE ( [Date from Slicer] )
RETURN
CALCULATE ( SUM ( Record[Amount] ), Calendar[Date] < __Dt )
+ CALCULATE (
SUM ( Record[Amount] ),
Calendar[Date] < __Dt,
USERELATIONSHIP ( Record[Date2], Calendar[Date] )
)
Hope this helps
David
Thank you so much, it's a very good suggestion!!
User | Count |
---|---|
16 | |
15 | |
14 | |
12 | |
11 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |