Slicer managing multiple columns across tables simultaneously

这一生的挚爱 提交于 2019-12-02 15:44:56

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!