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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
flemingg62
Helper I
Helper I

Replicating a Graph from Excel

Hi

I need help reproducing a graph I have in Excel in Powe BI and have been trying to write a measure to use in graphs

It calculates how many desk were utilised (at least once in the day) or  never utilised on a giving day. Where the data is recorded every hour (Slots)

flemingg62_0-1668803427112.png

 

 

I have 3 Tables that are linked

BI_Location_Building_Data (A list of all location (Desks))

  • Location
  • Building
  • Floor
  • Department

BI_Slots

  • Date                                      Calculated from Time Start 14/03/2001
  • TimeStart(Slots)                 Sample 14/03/2001 12:00
    • 14/03/2001 13:00
    • 14/03/2001 14:00
    • 14/03/2001 15:00
    • 14/03/2001 16:00

BI_SurveyData

  • ID                            Autonumber
  • Location
  • Utilised                 1 or 0

flemingg62_1-1668803427122.png

 

Can anyone help

 

1 ACCEPTED SOLUTION

Hi

Thanks cracked it  hsed need to add a filter

Locations Never Never used =
VAR _Used =
    CALCULATE(DISTINCTCOUNT(BI_SurveyData[Location]), FILTER(BI_SurveyData,BI_SurveyData[Utilised]=1))
VAR _ALL =
    CALCULATE ( DISTINCTCOUNT ( BI_SurveyData[Location]), ALL(BI_SurveyData[Location]) )
RETURN
   _ALL - _Used

View solution in original post

6 REPLIES 6
djurecic
Super User
Super User

Hi @flemingg62 ,

 Do you have a specific question that we can answer? You should be able to achieve this using a 100% Stacked Bar Chart.

 

https://powerbidocs.com/2020/01/25/power-bi-100-stacked-bar-chart/

 

Hi

Thanks, but I need a measure to count the numner of locations never used on each day 

Something along the lines of:

Never used =
VAR _Used =
    DISTINCTCOUNT ( Table[Locations] )
VAR _ALL =
    CALCULATE ( DISTINCTCOUNT ( Table[Locations), ALL(Table[Locations] ) )
RETURN
    _ALL - _Used




Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi - Thanks

Been paying around with it for a few hours and no luck, but almost there, the send part is returning the correct values, but the first part needs to be limited to desks never used in a day

 

Never used =

VAR _Used =

    DISTINCTCOUNT ( Table[Locations] ) I need to add a condition so that the values is limited to Location never used on a day, such as      FILTER(SUM(BI_SurveyData(Utilised] =0))      I have tried may variation but no luck

VAR _ALL =

    CALCULATE ( DISTINCTCOUNT ( Table[Locations), ALL(Table[Locations] ) )

RETURN

    _ALL - _Used

 I also have a measure, but no luck using this as well

Utilised Count = Sum((BI_SurveyData[Utilised]))

Can you share some dummy data or a link to a dummy PBIX file?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi

Thanks cracked it  hsed need to add a filter

Locations Never Never used =
VAR _Used =
    CALCULATE(DISTINCTCOUNT(BI_SurveyData[Location]), FILTER(BI_SurveyData,BI_SurveyData[Utilised]=1))
VAR _ALL =
    CALCULATE ( DISTINCTCOUNT ( BI_SurveyData[Location]), ALL(BI_SurveyData[Location]) )
RETURN
   _ALL - _Used

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors
Top Kudoed Authors