Forum Discussion
Need help to Display future date columns from slected date range
- 6 years ago
Hi Anonymous ,
Try this measure:
Measure 3 = VAR max_date = CALCULATE ( MAX ( 'Table 2'[selected date] ), ALLSELECTED ( 'Table 2'[selected date] ) ) VAR next_date = CALCULATE ( FIRSTNONBLANK ( 'Table (2)'[selected date], 1 ), FILTER ( 'Table (2)', 'Table (2)'[selected date] > max_date ) ) RETURN IF ( MAX ( 'Table (2)'[selected date] ) IN VALUES ( 'Table 2'[selected date] ) || MAX ( 'Table (2)'[selected date] ) = next_date, 1, 0 )Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , Your date range in not filtering selected date, then why do not you use after option in date slicer upcoming date.
https://radacad.com/from-and-to-date-slicers-in-power-bi-filtering-based-on-two-fields
Or you can create a measure like this. Prefer independent date slicer
Measure =
var _max= maxx(allselected(Date), Date[Date])
return
calculate(count(Table[upcoming Date), filter(Allselected(Table),Table[upcoming date] >_max))
Hi Amit,
Thank you for your quick response. sorry i missed the some of the part in my requirement. my updates are below
i am using only single date slicer for 2 reasons 1) is to display all dates in a table view in between selected date range .its working fine as regular.
2) when i use same date slicer i need to display upcoming dates only from selected date range in separate table view . in my intial post i explained this one. so i am trying with measure or calculated column.
i have tried creating measure like below as per your suggestion
futuredate= var v_max=maxx(Allselected('Date'),Date'[date])
return
calculate(count(Table([upcomingdate]),filter(Allseelcted(Table),Table[[upcomingdate]>=v_max)
when i choose "selected date" column for date slicer and selected date range as 5/1/2020 to 5/10/2020 then i am looking for upcoming dates > 5/10/2020 ( which is max date from selected date range) and expecting below output in table visual.
selected date is from date slicer here .
selected date future date
5/1/2020 6/1/2020
5/5/2020 7/5/2020
5/302020 8/20/2020
But when i use new created measure in table view i am getting the future dates count results only but I am expecting upcoming dates which are >=5/10/2020 as per above input
In below Date and futuredate displayed in table view (here date is from slicer,futuredate is taken from measure)
After applying measure iam getting results like below
date future date
5/1/2020 2
5/5/2020 2
5/302020 2
In given measure i tried with "selected value" function in measure but its not returning futuredatecoulm.
I am looking for expected output like below
date future date
5/1/2020 6/1/2020
5/5/2020 7/5/2020
5/302020 8/20/2020
Please look into this and help me with solution.
Thank you so much for your help in advance.
Thank you..
Mahi18
- Anonymous6 years agoNot applicable
Hi amitchandak ,
I have tried creating measure like below, intially it give me the count of future dates, but iam expecting upcoming date column deatils which are >=5/10/2020 as per requirement
futuredate= var v_max=maxx(Allselected('Date'),Date'[date])
return
calculate(count(Table([upcomingdate]),filter(Allseelcted(Table),Table[[upcomingdate]>=v_max)
I have tried with changing the measure logic by below options in return statement tried with 1) Allselected 2) Selectedvalue 3) HASONEVALUE 4)values 5)selectedcolumn options . ( tried all options but not getting exact output)
in all scenarios i am able to only one max date related to upclomingdate column. i am looking for below output as per the requirement
date future date
5/1/2020 6/1/2020
5/5/2020 7/5/2020
5/302020 8/20/2020
Could you please look into this and help me with solution.
Thank you so much for your help in advance.
Thank you..
Mahi18