Forum Discussion
Dynamic filters - Selected Value - DAX
- 7 years ago
Hi brunofs123,
To create a new calculated table and do not create relationship for the new table with other ones.
_newCalendar = CALCULATETABLE('dCalendar')Then we can add the date column in the new table in slicer and create a measure as below.
out valid DIN 2 = VAR SELECTED = SELECTEDVALUE('_newCalendar'[Date]) RETURN CALCULATE(SUM('FT - Outorgas validas 2'[Volume m3s]), FILTER('FT - Outorgas validas 2' , 'FT - Outorgas validas 2'[date venc] >= SELECTED && 'FT - Outorgas validas 2'[date public] <= SELECTED) )Please refer to the pbix.
Regards,
Frank
Thank you for replying. I was only able to see it today, but unfortunately it didn't work.
Here is lhe one drive link:
I'm afraid i post a wrong calculation in my orginal message:
esult =
VAR SELECTED = SELECTEDVALUE(dCalendar[Date])
RETURN
CALCULATE([volume m3s];
FILTER('Outorgas validas 2';
FT[date1] >= 15/01/2007 >= SELECTED &&
FT[date2] <=14/01/2007 <= SELECTED)
please desconsider the red lighted characters
thanks!
Hi brunofs123,
To create a new calculated table and do not create relationship for the new table with other ones.
_newCalendar = CALCULATETABLE('dCalendar')
Then we can add the date column in the new table in slicer and create a measure as below.
out valid DIN 2 =
VAR SELECTED = SELECTEDVALUE('_newCalendar'[Date])
RETURN
CALCULATE(SUM('FT - Outorgas validas 2'[Volume m3s]),
FILTER('FT - Outorgas validas 2' ,
'FT - Outorgas validas 2'[date venc] >= SELECTED &&
'FT - Outorgas validas 2'[date public] <= SELECTED)
)
Please refer to the pbix.
Regards,
Frank
- brunofs1237 years agoFrequent Visitor
Thank you!
Mind explaining why you had to create a new and unrelated Calendar?
Thanks..