Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Running count unique flag

Hi Guys,

 

I am new to PBI and need your help, I want to create a flag for unique workorder numbers, It is like creating a Rank for each Wonum. The senario and sample data below, Can you please help on this 

 

WonumRunning-CountWo Uniquie Flag
123411
123420
123430
123440
789611
789620

 

Wonum is what I have, A single wonum can be assigned to multiple peoples, I want to create a flag WO unique flag 1/0 for every wonum. Expected output is Wo Uniquie flag. PS: I don't have Running-Count calculated, I only have wonum from which I want tp derive flag. Thanks for your help

  • pnvinod's avatar
    pnvinod
    8 years ago

    Hi,

    1. Add a index column from Edit queries tab

    2. Add a Rank column 

    Rank = calculate(COUNTROWS(Table1),(FILTER(Table1, EARLIER(Table1[Index])>=Table1[Index])),Table1[Wonum]=EARLIER(Table1[Wonum]))

     

    Replace Table1 as appropriate 

     

     

     

  • pnvinod's avatar
    pnvinod
    8 years ago

    I have opened  Data View

    created New Column from Modelling Tab. I have tried with Text data for Wonum And it is working fine.

    Try to create the column with one filter on index and see if it works. Then add the second one.

9 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous wrote:

     

     

    Wonum is what I have, A single wonum can be assigned to multiple peoples, I want to create a flag WO unique flag 1/0 for every wonum. Expected output is Wo Uniquie flag. PS: I don't have Running-Count calculated, I only have wonum from which I want tp derive flag. Thanks for your help



    Hi Movva

      But , your sample data doesnt have the people, its simply assiging 1 for each unique WO and 0 for the duplicates. Is it that you want? If not , please share proper sample data with clear expected output.

     

    Thanks

    Raj

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Raj, Please find the sample data and output I am looking for below, my plan after struggling a lot today was to create a flag for unique WO..as posted the link requesting for possible way to achieve it. Can you please help me.. So tha sample data and the output I am looking for is below, I have already got woassigned flag created at the backend. I don't have running - count, Wo Uniquie Flag, and the calculation for sum(Job duration). PLEASE HELP

       

      WonumJobDuraintwoassigned flagEngineerRunning-CountWo Uniquie Flag
      123451Sandeep11
      123451Greg20
      123451Raj30
      123451Kevin40
      7896101Tom11
      7896101Sam20
      7654501Rahul11
      7654500Sandeep10
            
      Output     
      Sum(Jobduration) for each distinct WO where woassigned =1wonum    
      51234    
      107896    
      507654    
      • Anonymous's avatar
        Anonymous
        Not applicable

        Any help on this please? is this possible?