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
iandespradel
Regular Visitor

Visual % Days Worked

I work in a company that lends equipment and machinery for construction projects.

 

I have +100 equipment, each identify by an unique ID.

 

I have a log of all the borrowed equipment.(Status: "Active", id 1)

 

And a log of all the equipment being repaired.(Status: "Broken", id 2)

 

I dont't have a daily log of all the equipment available, waiting to be borrow (Status: "Standby", id 0)

 

I've combine both log tables, resulting:

 

Date                           ID.Equip             Status
10/5/2020                    A101                 Active
10/5/2020                    A102                 Active
10/5/2020                    A103                 Broken
.
.
.
10/6/2020                    A101                 Active
10/6/2020                    A102                 Broken
10/6/2020                    A103                 Active
.
.
.
10/8/2020                    A101                 Active
10/10/2020                  A102                Broken
11/11/2020                  B103                 Active

 

If an equiment isn't shown in this table, it means it's in "Standby" for that date (the date is not shown either, as it jumps to the next registry). And not all the equipment ids are listed, because not all equipment have had being "active" or "broken" atm.


I also have a database table with a list of all the equipment.
A101
A102
A103
A104
B101
B102

.

.

.

 

And a calendar table.


I want to create a visual that shows the % of the days "Broken" in a month from the total of days

 

And a visual that shows the % of the "Active" days from the "Standby" days

 

And maybe a combination of "Standby", "Active" and "Broken" as a stacked or 100% stacked chart.

 

I've attached and Example of the data and the types of visuals I have in mind:
PowerBI 

Table 1 

Table 2 

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @iandespradel ,

 

How about the result after you follow the suggestions mentioned in my original post?

Could you please provide more details or expected result about it If it doesn't meet your requirement?

If you've fixed the issue on your own please kindly share your solution. If the above posts help, please kindly mark it as a solution to help others find it more quickly.

 

Best regards,

 

Community Support Team _ zhenbw

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

v-zhenbw-msft
Community Support
Community Support

Hi @iandespradel ,

 

Do you want to show a pie chart and 100% column chart like this? You can refer the page 2 in the pbix that we attached.

 

Visual1.jpg

 

If yes, you need to create two measures for pie chart.

 

Broken = CALCULATE(DISTINCTCOUNT('00_CONTROL'[Fecha]),FILTER(iStatus_Eq,iStatus_Eq[Status.Eq]="Broken"))

 

Total with no Broken = CALCULATE(DISTINCTCOUNT('00_CONTROL'[Fecha]),ALLSELECTED('00_CONTROL'))-[Broken]

 

Then you can add a slicer to control the Month.

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

amitchandak
Super User
Super User

@iandespradel , check if a measure like this can work

 

Broken % =
var _tot = countx(equipment,equipment[ID])
return
divide(calculate(distinctcount(Table[ID.Equip]), filter(Table, Table[Status] ="Broken")), _tot)

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.

Top Solution Authors