Forum Discussion

harshadrokade's avatar
harshadrokade
Post Partisan
4 years ago
Solved

Disable specific filter on tooltip chart

Hi All,

Appreacite your help on his in advance.

 

I have below data

Month-DD/MM/YYYYValueStudent nameSubject name
01/01/2020100AABC1
01/03/202080AABC1
01/08/202090AABC1
01/12/202070AABC1
01/01/202070AABC2
01/03/202080AABC2
01/08/202090AABC2
01/12/2020100AABC2
01/01/202010BABC1
01/03/2020100BABC1
01/08/202070BABC1
01/12/202040BABC1
01/01/202030BABC2
01/03/202080BABC2
01/08/202030BABC2
01/12/202010BABC2

 

I have created multi row card based on few parameters & data in that card shown on date level like example given below

 

Card1

01/01/2020  100AABC1

 

Card2

01/03/2020  80AABC1

 

Card3

01/08/2020  90AABC1

etc..

 

I have a tooltip column chart created with latest two dates filtered on filter pane of the chart. This chart is shown on hovering the multi row card but when I hover on multi row card of a specific month, it shows the value only of that month & not recent two months.

 

How to get to see recent two month values on hovering on any specfic date card of multi row card?

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi harshadrokade,

    I think you need to change your tooltip report page DAX expression to add 'all' functions to ignore the current filter and add variables to store and calculate the previous date period.

    Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

    Then you can use this variable as a condition to calculate corresponding results.

    formual =
    VAR currDate =
        MAX ( Table[Date] )
    VAR prevDate =
        DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) )
    RETURN
        CALCULATE (
            SUM ( Table[Value] ),
            FILTER ( ALL ( Table ), [Date] = prevDate ),
            VALUES ( Table[Student name] ),
            VALUES ( Table[Subject name] )
        )

    Regards,

    Xiaoxin Sheng

4 Replies

    • harshadrokade's avatar
      harshadrokade
      Post Partisan

      Hi Anonymous 

       

      I have created a tooltip chart as below where I have added a filter that filters the chart by showing latest 2 dates on X axis. I want to show this chart on card visual (Shown below) when I hover on a specific card from the multi card. The issue is when I hover on the card, it shows me only latest year on tooltip bar chart. It may be because the card visual also has a filter applied as mentioned below-

       

       

       

      Sample dummy data-

      Month-DD/MM/YYYYValueStudent nameSubject name
      01-01-2020100AABC1
      01-03-202080AABC1
      01-08-202090AABC1
      01-12-202070AABC1
      01-01-202070AABC2
      01-03-202080AABC2
      01-08-202090AABC2
      01-12-2020100AABC2
      01-01-202010BABC1
      01-03-2020100BABC1
      01-08-202070BABC1
      01-12-202040BABC1
      01-01-202030BABC2
      01-03-202080BABC2
      01-08-202030BABC2
      01-12-202010BABC2
      01-01-202040AABC3
      01-03-202030AABC3
      01-08-202080AABC3
      01-12-2020100AABC3
      01-01-202010BABC3
      01-03-2020100BABC3
      01-08-202070BABC3
      01-12-202040BABC3
      01-01-202040AABC4
      01-03-202030AABC4
      01-08-202080AABC4
      01-12-2020100AABC4
      01-01-202010BABC4
      01-03-2020100BABC4
      01-08-202070BABC4
      01-12-202040BABC4

       

      Multi card visual with filter aplied to show only latest year data. So when you hover on latest card of a specific Subject (filtered on latest month), you should be able to see last two period bar chart created on tooltip chart tab.

       

      As of now it shows the column chart of only latest year as below. I want to see previous year comparison on column chart for the selected student & subject on which hover is done.

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi harshadrokade,

        I think you need to change your tooltip report page DAX expression to add 'all' functions to ignore the current filter and add variables to store and calculate the previous date period.

        Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT - SQLBI

        Then you can use this variable as a condition to calculate corresponding results.

        formual =
        VAR currDate =
            MAX ( Table[Date] )
        VAR prevDate =
            DATE ( YEAR ( currDate ) - 1, MONTH ( currDate ), DAY ( currDate ) )
        RETURN
            CALCULATE (
                SUM ( Table[Value] ),
                FILTER ( ALL ( Table ), [Date] = prevDate ),
                VALUES ( Table[Student name] ),
                VALUES ( Table[Subject name] )
            )

        Regards,

        Xiaoxin Sheng