Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

How to get Rank values without blanks

how to get rank values from starting from 1 when the rest values are blanks

 

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

     

    Use the measure.


    Rank= 

    IF (NOT(ISBLANK([Total Sales)),RANKX(ALLSELECTED(Location_Date),[Total Sales,],ASC))

     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Rank =

       

      Var Ranky = RANKX(ALLSELECTED(Location_Data),CALCULATE([Total sales]),,ASC) Return IF(NOT(ISBLANK([Total sales])),Ranky,BLANK())

       

      but still getting the same as above

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        Please use the measure which I sent.

         

        Here yu have already calculated the rank in var ranky.

         

        While I am calculating rank only when Sales is not blank.

         

        Both are different.

         

        Regards,

        HN

  • Anonymous's avatar
    Anonymous
    Not applicable
    Rank =
    if(
    	HASONEFILTER( T[Name] )
    	&&
    	[Total Sales] <> 0,
    	
    	RANKX(
    		FILTER(
    			ALLSELECTED( T[Name] ),
    			[Total Sales] <> 0
    		),
    		[Total Sales],
    		,
    		ASC,
    		Dense
    	)
    	
    )

     

    Best

    D