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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Change occupation in days to occupation in %

Goodmorning,

 

I'm working on a report to show the occupation of certain machines in days. I have a Start Date and End Date linked to a calender, and got the count of days in the slicer working correctly. But i'd like to show the data in percentages.

I want to filter in years, months and weeks. So for instance in week 42 of 2018 when a machine is occupied for 7 days the occupancy should be 100%. If it is possible i want the data at the bottom of the bar to show the occupancy in a percentage.

And when i change the filter to a month, it should calculate the occupancy in days/month.

 

Occupation.PNG

 

Thanks in advance for any help!

1 ACCEPTED SOLUTION
yelsherif
Resolver IV
Resolver IV

Please provide sample data table to be able to understand correctly.

Instead of using the data directly from the table, you can create a measure that follows your filter selection.

Something like

 

SelectionMeasure =

      if(isfiltered(monthSlicerTable),

             divide(distinctcount(datatable[days],

                        day(

                               date(

                                        selectedvalue(yearSlicerTable[year]),

                                        selectedvalue(monthSlicerTable[month])+1,

                                        1
                              )-1),
                       0),

             divide(distinctcount(datatable[days], 7, 0)

      )

 

Then you can use the measure in your visual

View solution in original post

2 REPLIES 2
yelsherif
Resolver IV
Resolver IV

Please provide sample data table to be able to understand correctly.

Instead of using the data directly from the table, you can create a measure that follows your filter selection.

Something like

 

SelectionMeasure =

      if(isfiltered(monthSlicerTable),

             divide(distinctcount(datatable[days],

                        day(

                               date(

                                        selectedvalue(yearSlicerTable[year]),

                                        selectedvalue(monthSlicerTable[month])+1,

                                        1
                              )-1),
                       0),

             divide(distinctcount(datatable[days], 7, 0)

      )

 

Then you can use the measure in your visual

Anonymous
Not applicable

The table at the top right is the data i'm working with. I editted out some "secret" info.

As i filter the count of date changes to the amount of dates it is occupied in that given periode.

 

Occupation3.png

 

Will look into your dax formula to see if i can work it out.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.