Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Duplicate Ranks

Hi Please find the sample pbix file and Expected output. Here i want to show Top 50 providers on rank wise while sorting the paid amount. Here am using table visual with diffrent dimenssons and Facts.

Note: Here my orginal source is tabular model so i can't create index column so we need to apply dax to show ranks top 50 records(like need to add incremental column) , i have already filtered out Top 50 records just i want show one column for Ranks.

Rankx = RANKX(ALL('Fact_Claim_Base_Vw'),[Paid Amount],,DESC,Dense)-- it's showing duplicate records.
Here am using another measure to show one column for ranks, this is working fine in tabular database level but not working on Power Bi.
evaluate
ADDCOLUMNS(test, "Rank", countrows(FILTER (TEST,[Paid_Amount]>=EARLIER([PAID_AMOUNT]) )
))
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Harsh Thanks for giving reply, Iam using same query which you sent but Still it's displaying duplicates ranks. I undestand might be you are using Network Licence[ Network Licence key] column but orginal report i amNot  using any key column, and it should be  Network Licence[Network Licence Number]. While am using this column am getting error. Please suggest me how Can i get the Ranks.

     

     

13 Replies

Replies have been turned off for this discussion
  • az38's avatar
    az38
    Community Champion

    Hi Anonymous 

    try a measure

    Measure rankx = 
    RANKX(
    ALL('Fact_Claim_Base_Vw'[Name]), 
    CALCULATE(SUM('Fact_Claim_Base_Vw'[Paid Amount])) 
    )

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Please refer the attached pbix file, what ever the solution you given it wont work becacuse name came from different table. I tried all the possible ways and seeking help.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amit, I gone through the links still i didn't find the my exact solution. If you are able to help me please find the sample data and expected output on my orginal post.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

     

     

     

    Create the below measures.

     

    paid Amount1 = CALCULATE(SUM(Fact_Claim_Base_Vw[Paid Original Amount]),FILTER(Provider, Provider[SCD_LATEST_FLG] = TRUE()))
     
     
     
     
    Rankx =
    IF (
    NOT (
    ISBLANK ( [paid Amount1] )
    ),
     
    RANKX(
    FILTER (
    SUMMARIZE (
    ALL ( Fact_Claim_Base_Vw ),
    Fact_Claim_Base_Vw[DOS_NETWORK_LICENSE_KEY],
    Provider[Name],
    Provider[PROVIDER_GID],
    'Network License'[NETWORK_LICENSE_KEY]
    ),
    'Network License'[NETWORK_LICENSE_KEY] = Fact_Claim_Base_Vw[DOS_NETWORK_LICENSE_KEY]
    ),
    [paid Amount1]
    )
    )
     

     

    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

      Hi Harsh Thanks for giving reply, Iam using same query which you sent but Still it's displaying duplicates ranks. I undestand might be you are using Network Licence[ Network Licence key] column but orginal report i amNot  using any key column, and it should be  Network Licence[Network Licence Number]. While am using this column am getting error. Please suggest me how Can i get the Ranks.