Forum Discussion

Anshenterprices's avatar
4 years ago
Solved

Display max date value in table while selection of any date from slicer

Hi Team,   Source Data Date category Value Type 10/3/2021 Commodity 50 Broker 10/3/2021 equity 10 Broker 10/2/2021 equity 30 Broker 10/2/2021 Commodity 30 Broker 1...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    4 years ago

    Hi, Anshenterprices 

     

    I'm a bit busy today so I didn't have time to reply. You need to use summraize function to calculate total.

    You can try:

    Online = 
    SUMX (
        SUMMARIZE (
            'Table 1',
            [category],
            [SubCategory],
            [Date],
            [Type],
            [Value],
            "online1",
                VAR a =
                    MAXX (
                        FILTER (
                            ALL ( 'Table 1' ),
                            [Date] < SELECTEDVALUE ( 'Table 1'[Date] )
                                && [Type] = "Online"
                        ),
                        [Date]
                    )
                RETURN
                    SUMX (
                        FILTER (
                            ALL ( 'Table 1' ),
                            [Date] = a
                                && [Type] = "Online"
                                && [category] = SELECTEDVALUE ( 'Table 1'[category] )
                                && [SubCategory] = SELECTEDVALUE ( 'Table 1'[SubCategory] )
                        ),
                        [Value]
                    )
        ),
        [online1]
    )
    

    Did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.


    Best Regards,

    Community Support Team _ Janey