The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have a report with KPI visual and i need to filter this visual only for last 08 days when the user select a date.When select a date the KPI chart automatically should show last 08 days.Can some one help me to do this?
Solved! Go to Solution.
Hi @Anonymous ,
If you only want to filter last 8 days, you need a separate date table.
dynamic Date =
VAR _select =
CALCULATE ( MAX ( DateTable[Date] ), ALLSELECTED ( DateTable[Date] ) )
VAR _last7days = _select - 8
RETURN
IF (
MAX ( 'MainTable'[Date] ) >= _last7days
&& MAX ( 'MainTable'[Date] ) < _select,
1,
0
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
If you only want to filter last 8 days, you need a separate date table.
dynamic Date =
VAR _select =
CALCULATE ( MAX ( DateTable[Date] ), ALLSELECTED ( DateTable[Date] ) )
VAR _last7days = _select - 8
RETURN
IF (
MAX ( 'MainTable'[Date] ) >= _last7days
&& MAX ( 'MainTable'[Date] ) < _select,
1,
0
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , refer if this old solution can work
or
Rolling last 8 days with date table
Rolling 8 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],'Date'[Date],-8,Day))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Hi ,
I created a measure to get last 08 days with the MAX date in the date table.This is the measure,
dynamic Date =
VAR _select =
CALCULATE ( MAX ( DateTable[Date] ), ALLSELECTED ( DateTable[Date] ) )
VAR _last7days = _select - 7
RETURN
IF ( _select > _last7days, 1, 0 )
but this shows dates from 1st of january to 22nd of january. i need to get only last 08 days.
And i need to put a filter in the filter pane like this,
Dynamic date= 1