Forum Discussion

Thennarasu_R's avatar
Thennarasu_R
Icon for Responsive Resident rankResponsive Resident
3 years ago
Solved

How to Took TopN Values

Hi,

I have one Date Column and then created One serial No Column 1, 2,3,....etc based on Date Column.

My need is 3 task, max Top 7, Top 14,top 30 Days in Dax 

can you anyone help me this one 

  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

    Value top seven: =
    CALCULATE (
        SUM ( Data[Value] ),
        KEEPFILTERS (
            TOPN ( 7, ALL ( Data[Date] ), CALCULATE ( SUM ( Data[Value] ) ), ASC )
        )
    )
    

4 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

    Value top seven: =
    CALCULATE (
        SUM ( Data[Value] ),
        KEEPFILTERS (
            TOPN ( 7, ALL ( Data[Date] ), CALCULATE ( SUM ( Data[Value] ) ), ASC )
        )
    )
    
      • Jihwan_Kim's avatar
        Jihwan_Kim
        Icon for Super User rankSuper User

        Please share your sample pbix file's link, and then I can try to look into it.

        Or, please check whether you are creating a measure or a column.

        The DAX formula that I provided is for creating a measure.

        Thanks.