Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Calculate Percent from document

Hello everyone !

 

I'm blocked on a little problem since few days ...

 

I make a measure for calculcate the difference between the date creation of a document and the date when the document is validate. 

 

Measure 2 = SUMX(FILTER(Dates;Dates[Date] >= MIN(FrVentes[DATE RECEPTION COMMANDE]) && Dates[Date] <= MAX(FRVentes[DATE]));Dates[IsWeekDay?])

After this, i try to calculate how many document got a difference of 5 days between these date.

 

But i didn't know how to get this amount.

 

I try several measure like : 

 

Measure = CALCULATE(DISTINCTCOUNT(FRVentes[N DOCUMENT ]);ISBLANK(FRVentes[DATE RECEPTION COMMANDE])=FALSE;[Measure 2]<= 5)

 

Have you any idea ? 

 

Thank you very much for your helping

 

 

 

 

 

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    I find the solution ! 

     

    There it is :

     

    Measure = 
    CALCULATE(COUNTROWS(FILTER(
            SUMMARIZECOLUMNS(FRVentes[N DOCUMENT ];
                "abc"; FRVentes[Measure 2];"date";MAX(FRVentes[DATE RECEPTION COMMANDE])
            );
            [abc] < 5
        )
    );ISBLANK(FRVentes[DATE RECEPTION COMMANDE])=FALSE)

    Thank you again !

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I forgot to put a visual on my Table.

     

     

  • v-ljerr-msft's avatar
    v-ljerr-msft
    Microsoft Employee

    Hi Anonymous,

     

    If I understand you correctly, the formula below should work in your scenario. :smileyhappy:

    Measure =
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                FrVentes;
                FRVentes[N DOCUMENT ];
                FrVentes[DATE RECEPTION COMMANDE];
                FrVentes[DATE RECEPTION COMMANDE];
                "abc"; [Measure 2]
            );
            [abc] <= 5
        )
    )
    

     

    Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello !

       

      Thank you very much ! But that didn't works :(

       

      I got the count of all document (approximately 14K), but i have only 31 doc with [measure 2] > 5.

       

      I put a screen of what i try to get :

       

       

      Thank you very much for helping me !

      • v-ljerr-msft's avatar
        v-ljerr-msft
        Microsoft Employee

        Hi Anonymous,

         

        Could you share a dummy pbix file(with just some mock data) which can reproduce the issue. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. :smileyhappy:

         

        Regards