Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 months ago
Solved

cumulative total tooltip

Hi I trying to create a tooltip report page that I can use to show cumulative total. 

Problem is cumulative total is showing in data labels but when I use it in tooltip report page it is showing values of that month only but not the cumulative total.


Original DAX which is showing right cumulative total in data labels - 

14.2 Cumulative Actual Cost CY running total in Month =
VAR SelectedMaxDate = MAX('Dim_Calender'[Date])  -- from slicer
VAR CurrentRowDate = MAX('Su_Calender Trend'[Date])  -- from visual context
 
RETURN
IF(
    CurrentRowDate <= SelectedMaxDate,
    CALCULATE(
        [14.2 Cumulative Actual Cost CY],
        FILTER(
            CALCULATETABLE(
                SUMMARIZE(
                    'Su_Calender Trend',
                    'Su_Calender Trend'[Monthnum],
                    'Su_Calender Trend'[Month],
                    'Su_Calender Trend'[Date]
                ),
                ALLSELECTED('Su_Calender Trend')
            ),
            ISONORAFTER(
                'Su_Calender Trend'[Monthnum], MAX('Su_Calender Trend'[Monthnum]), DESC,
                'Su_Calender Trend'[Month], MAX('Su_Calender Trend'[Month]), DESC
            )
        )
    ),
    BLANK()
)
  • HI Anonymous 

    If I understand correctly, your custom tooltip needs to show cumulative total without getting filtered for that month.

    In that case it will always show a single value right?

    Can you add little bit more details here please?

     

    Also the DAX that you have shared above has got an ALLSELECTED which is basically filtering the totals for the month when shown on a custom tootltip.

    If you modify it to ALL, then it should always show your one cumulative total irrespective of what month you hover it on. 

    Basically the updated dax will be:

    14.2 Cumulative Actual Cost CY running total in Month =
    VAR SelectedMaxDate =
        MAX ( 'Dim_Calender'[Date] ) -- from slicer
    VAR CurrentRowDate =
        MAX ( 'Su_Calender Trend'[Date] ) -- from visual context
    RETURN
        IF (
            CurrentRowDate <= SelectedMaxDate,
            CALCULATE (
                [14.2 Cumulative Actual Cost CY],
                FILTER (
                    CALCULATETABLE (
                        SUMMARIZE (
                            'Su_Calender Trend',
                            'Su_Calender Trend'[Monthnum],
                            'Su_Calender Trend'[Month],
                            'Su_Calender Trend'[Date]
                        ),
                        ALL ( 'Su_Calender Trend' )
                    ),
                    ISONORAFTER (
                        'Su_Calender Trend'[Monthnum], MAX ( 'Su_Calender Trend'[Monthnum] ), DESC,
                        'Su_Calender Trend'[Month], MAX ( 'Su_Calender Trend'[Month] ), DESC
                    )
                )
            ),
            BLANK ()
        )
    

    Let me know if this helps.

     

1 Reply

  • HI Anonymous 

    If I understand correctly, your custom tooltip needs to show cumulative total without getting filtered for that month.

    In that case it will always show a single value right?

    Can you add little bit more details here please?

     

    Also the DAX that you have shared above has got an ALLSELECTED which is basically filtering the totals for the month when shown on a custom tootltip.

    If you modify it to ALL, then it should always show your one cumulative total irrespective of what month you hover it on. 

    Basically the updated dax will be:

    14.2 Cumulative Actual Cost CY running total in Month =
    VAR SelectedMaxDate =
        MAX ( 'Dim_Calender'[Date] ) -- from slicer
    VAR CurrentRowDate =
        MAX ( 'Su_Calender Trend'[Date] ) -- from visual context
    RETURN
        IF (
            CurrentRowDate <= SelectedMaxDate,
            CALCULATE (
                [14.2 Cumulative Actual Cost CY],
                FILTER (
                    CALCULATETABLE (
                        SUMMARIZE (
                            'Su_Calender Trend',
                            'Su_Calender Trend'[Monthnum],
                            'Su_Calender Trend'[Month],
                            'Su_Calender Trend'[Date]
                        ),
                        ALL ( 'Su_Calender Trend' )
                    ),
                    ISONORAFTER (
                        'Su_Calender Trend'[Monthnum], MAX ( 'Su_Calender Trend'[Monthnum] ), DESC,
                        'Su_Calender Trend'[Month], MAX ( 'Su_Calender Trend'[Month] ), DESC
                    )
                )
            ),
            BLANK ()
        )
    

    Let me know if this helps.