Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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 !

View solution in original post

6 REPLIES 6
v-ljerr-msft
Employee
Employee

Hi @Anonymous,

 

If I understand you correctly, the formula below should work in your scenario. Smiley Happy

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

 

Regards

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 :

 PowerBI4.JPG

 

Thank you very much for helping me !

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 uploadingSmiley Happy

 

Regards

Anonymous
Not applicable

Hello ! 

 

Thank you again for helping me 😉

 

There is the file : file

 

I put some example. 

PowerBI5.JPG

 

 

You can see some document, i had to purge when the date start doesn't exist, and i try to make a percent of all document who got measure 2 < 5.

 

Thank you again for helping !

Anonymous
Not applicable

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 !

Anonymous
Not applicable

I forgot to put a visual on my Table.

 

PowerBI3.JPG

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.