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

Percentagem from a calculated value

I have a calculated value that filter the hours worked from two employee.

 

They work on several projects, and I got the amount of hours with the following measure

 

Hours = 
                    DIVIDE(
                    CALCULATE(
                                SUM(fApontamento[timeworked]);
                                FILTER(
                                        fApontamento;
                                        fApontamento[author] = "employee1" || fApontamento[author] = "employee2"
                                        )
                            );3600)

I am able to list the hours from each project now.

 

image.pngimage.png

 

Now I need to know the percentage spent on each project and I have no idea on how to do that.

On the stacked barchart I need to replace the hours with the percentage.

 

 

1 ACCEPTED SOLUTION

Hi,

Assuming Total is a measure, write this measure

Measure2 = [Total]/CALCULATE([Total],ALL(Data[Projecto]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

Not sure if it understand it right but I think you need something like below

Sales Red blue % Brakedown = 
VAR author = {"employee1", "employee2"}
VAR authorHrs = CALCULATE(
    SUM(fApontamento[timeworked]);
    KEEPFILTERS( fApontamento[author] IN author )
)
VAR authorHrsAll = CALCULATE(
    SUM(fApontamento[timeworked]);
    fApontamento[author] IN author
)
RETURN DIVIDE( authorHrs, authorHrsAll )

 

Regards.

Mariusz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you @Mariusz  for your time, but I'm afraid to say that it didn't fit my problem.

 

The measure that I have brings me the value 744,30. If I put it on a table with the projects, it brake the value into the projects's values, as shown on the pic.

 

I need to calculate the percentage of that broken value of each project with the value 744,30

 

EVO Almoxarifado = 67,50

EVO Aplicativo = 16,80

.

.

.

 

So I don't know how to get each of these value and divide it by 744,30, to get the final percentage of the projects 

Hi @Anonymous 

Can you use Excel to demostrate what is the outcome that you are expecting?

Many Thanks

Mariusz

Anonymous
Not applicable

Sure @Mariusz , I can show you on the image below

 

image.png

I need to divide the total column by total All projects.

 

I sum up all the rows where employee1 and employee2 worked. They are from the test department.

I know that the test department worked on a project by the column timeworked. 

I am making a report to display the hours spent on each project. The values from the grid that I've put on the first was gathered with the measure.

The real point, is how to calculate the percentage from the projects where the test department worked.

 

This is my dataset.

image.png

 

I really appreciate your help

Hi,

Assuming Total is a measure, write this measure

Measure2 = [Total]/CALCULATE([Total],ALL(Data[Projecto]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi, 

 

It worked!

 

Thank you Ashish, you saved me.

 

Best regards,

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.