问题
I have a report page which contains tables about cars and bikes. Each of them is a separate table like:
Cars
Id | CarName | Time1
Bikes
Id | BikeName | Time2
There are no relationships between these tables however they must be displayed in same page. How can i use a Slicer
or a Timeline 2.0.1
to manipulate all dashboards simultaneously by just filtering once the date?
I.e. If i select interval between 01/01/19-02/02/19 it will filter the Cars
by field Time1
and the Bikes
by Time2
and display the dashboards accordingly?
Thanks so much!
回答1:
Build a CalendarTable and link both tables bikes and cars to it. You may find lots of propositions of CalendarTables. Then make slicer on CalendarTable. Beware not to make slicer on your fact tables bikes or cars.
There are more advantages to using CalendarTable then just the possibility of filtering multiple tables. I would use CalendarTable even with a single table because it contains complete list of days - your bike table may not - and that is why time intelligence functions work properly. And mind the performance - slicing small and unique CalendarTable is faster then big fact tables.
Here is an example of simple CalendarTable. Choose in menu Modeling / New Table:
Calendar =
GENERATE (
CALENDAR (
DATE ( 2016, 1, 1 ),
DATE ( 2020, 12, 31 )
),
VAR CurrentDay = [Date]
VAR day = DAY ( CurrentDay )
VAR month = MONTH ( CurrentDay )
VAR year = YEAR ( CurrentDay )
VAR YM_text = FORMAT ( [Date], "yyyy-MM" )
RETURN
ROW (
"day" , day,
"month" , month,
"year" , year,
"YM_text" , YM_text
)
)
Set up min and max date. Here from 2016-01-01 to 2020-12-31.
来源:https://stackoverflow.com/questions/54954376/slicer-managing-multiple-columns-across-tables-simultaneously