Forum Discussion

SebSchoon1's avatar
SebSchoon1
Icon for Post Patron rankPost Patron
4 years ago

Rank on measure not working

Hi Guys,

 

I'd like to rank an information retrieved from a measure.

 

here is the concerned measure

 

Articles avec une quantité 95 (Reste a partager2) =
IF([Articles avec une quantité 95 (Reste a partager1)]<>blank(),
[Articles avec une quantité 95 (Reste a partager1)],
BLANK())

This measure provide me te correct result (But no total? 🤷‍♂️)

 

here is the result + expected result

 

 

 

Then i'd like to create a Rank based on this measure 

 

i tried so many ways but nothing seems to work 😞

 

Tanks guys for any help !

 

 

2 Replies

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, SebSchoon1 ;

    If Total is not displayed, you can use the ISINSCOPE() function,
    If it's a sorting problem, since you're sorting for a measure case, can you share a simple file? Because the sorting problem changes according to the actual situation, I can't reproduce your data or similar data.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • SebSchoon1's avatar
      SebSchoon1
      Icon for Post Patron rankPost Patron

      Hi v-yalanwu-msft 

       

      Here is the sample file.

       

      https://we.tl/t-6h1HxYeedf

       

      My final objective is to create a kind of loop but step by step.

       

      If The Items [CODE ARTICLE] have multiple sizes with only one quantity,

       

      i'd like to distribute these heavenly accros my warehouses [CODE DEPOT]

       

      To do This i have a rank by Size (index made in power query)

       

      I check if thy have 1 quantity in the validated stock  'Table Dispatch'

       

      I sum the total here 7 sizes for one [CODE ARTICLE]

       

      I take The attributed rank.

       

      from 1 to 13 in my case,  but only 7 items in stock and Only two warehouses [Total Dépots]

       

      Si i would like to share By [CODE DEPOT] Rank

       

      Each Sizes With The Rank They Have 

       

       

      Then I would like to Substract the 2 distributed quantities from the total Sizes available

       

      so 2-7 = 5 items to share.

       

      Take the concerned Ranks of the 5 remaining items.

       

      Rank these from 1 to 5 

       

      Compare to number of available warehouses ([CODE DEPOT]

       

      so it will remove 2 again

       

      Doing  5 - 2 = 3 

       

      Tanke The rank of the remaining ranks of the 3 items so from 1 to 3

       

      Compare the number of warehouses with the obtained Rank.

       

      So it will remove 2 again.

       

      3-2 = 1 

       

      Rank The rank of the remaining item. 1 to 1

       

      Compare to the number of warehouses

       

      so it will remove 1  

       

      [Rank] = [Rank Taille] 

       

      1 - 1 = 0   ==> END

       

      I must do this for up to 15 Sizes in 2 warehouses.

       

      is there a way to create a loop?