Forum Discussion
Display a calculated value based on start date and end date filters
- 5 years ago
Hi John2029 ,
You need to create 2 slicer tables as below:
Start date = VALUES('Table'[Start date])End date = VALUES('Table'[End date])Then create 3 measures as below:
startdate value = CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[Start date]=SELECTEDVALUE('Start date'[Start date])))Enddate value = CALCULATE(MAX('Table'[value]),FILTER(ALL('Table'),'Table'[End date]=SELECTEDVALUE('End date'[End date])))%increase = DIVIDE('Table'[startdate value], 'Table'[Enddate value])-1And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
Hi John2029 ,
You need to create the Start and End filter based on disconnected tables and then make your calculations based on that.
value start date = CALCULATE([value], Filter('MyTable','MyTable'[Start date] = MAX(StartDate[Date]))
value end date = CALCULATE([value], Filter('MyTable','MyTable'[End date] = MAX(EndDate[Date]))
Now you can divide this two values.
The trick is having the disconnected tables for the filtering of the data.
Hi MFelix,
Ah, thank you for your reply!
1. I changed the "value end date" and "value start date" measures to filter on max date as you advised
2. I disconnected the slicer "Start date" and "End date" one from each other using the "Edit interaction" feature in the Format menu to be able to select a different start date and a different end date
3. I created a measure to show the increase in % :
% Increase = DIVIDE([value end date], [value start date])-1
The start value and end value show the correct value based on date selection
But the increase shows -100%.
I am trying to make it do 160/100-1 to show 60%.
Do you have any idea what I am doing wrong?
Thank you again very much for your initial answer on the filter 🙂