Forum Discussion

ylebec's avatar
ylebec
Regular Visitor
7 years ago
Solved

Table relationship with aggregated data and time slider visual

Hi,   I have a table with the scheduled services to be operated depending by day type (Weekday, Saturday, Sunday)     Then another tablewith thte actual services operated over the first 5 ...
  • v-chuncz-msft's avatar
    7 years ago

    ylebec,

     

    Add a calculated column and use two measures.

    Type =
    SWITCH ( WEEKDAY ( Table2[Date] ), 1, "Sunday", 7, "Saturday", "Weekday" )
    
    Measure =
    SUMX (
        VALUES ( Table2[Type] ),
        CALCULATE (
            COUNTROWS (
                FILTER ( Table1, Table1[Day of Operation] = SELECTEDVALUE ( Table2[Type] ) )
            )
                * DISTINCTCOUNT ( Table2[Date] )
        )
    )
    
    Measure 2 =
    COUNTROWS ( Table2 )