Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am trying to get a totall occupancy for a group of locaions. We have some locations that have two people per room and some that have one person per room. Both people are in the database but they will have the same unit number. The other zinger here is that the Max Occupancy changed at one locaton to a lower ammount. Here is a sample of the data:
Date | Location | ID | Max occupancy | Date | Location | ID | Max Occupancy | ||
9/29/2020 | Fargo | 101 | 140 | 10/1/2020 | Moorhead | 502 | 108 | ||
9/30/2020 | Fargo | 102 | 140 | 10/1/2020 | Moorhead | 503 | 108 | ||
10/1/2020 | Fargo | 300 | 140 | ||||||
9/29/2020 | Moorhead | 500 | 115 | ||||||
9/29/2020 | Moorhead | 500 | 115 | ||||||
9/29/2020 | Moorhead | 502 | 115 | ||||||
9/29/2020 | Moorhead | 503 | 115 | ||||||
10/1/2020 | Moorhead | 500 | 108 | ||||||
10/1/2020 | Moorhead | 500 | 108 |
So, I need to count the ID of 500 as 1 as we do not look at people but at units when looking at occupancy.
Issue number 1. Numerator needs to be 1 count per unit per day.
Issue number 2. The denominator changes October 1st. So I want to use the old Max through the 30th and the new max going forward.
Thanks for any help.
Peter
Solved! Go to Solution.
Hi @petermb72 ,
Please check the following measure.
Measure = CALCULATE(DISTINCTCOUNT('Table'[ID]),ALLEXCEPT('Table','Table'[Date],'Table'[Location]))/SELECTEDVALUE('Table'[Max occupancy])
Result would be shown as below.
Best Regards,
jay
The desired output would be showing what my occupancy based on rooms, not ID numbers is each day. So for instance:
Occupancy Percentages:
9/29 Fargo 1 divided by 140
9/30 Fargo 1 divided by 140
10/1 Fargo 1 divided by 140
9/29 Mooread 3 divided by 115 (ID 500 has two on the same date, that is a shared room I want to only count as 1)
10/1 Moorhead 3 divided by 108 (ID 500 is doubled up on same date so they are in one unit and the max occupancy has shrunk to 108 vs 115)
So what I want to get for the max occupancy is
9/29 Fargo Occ = .7%
9/29 Moorhead Occ = 2.6%
10/1 Fargo Occ = .7%
10/1 Moorhead = 2.78%
Does this help?
Hi @petermb72 ,
Please check the following measure.
Measure = CALCULATE(DISTINCTCOUNT('Table'[ID]),ALLEXCEPT('Table','Table'[Date],'Table'[Location]))/SELECTEDVALUE('Table'[Max occupancy])
Result would be shown as below.
Best Regards,
jay
Thanks for that.
A measure like this
Measure = DIVIDE(DISTINCTCOUNT(TableGH[ID]) ,MIN(TableGH[Max occupancy]))
Alter the Measure Format for decimal places/percentage
I know the subject description stinks, but comeone one of you people with huge brains surely know the answer to this.........
I think the huge brains will know the answer but they might not know the question!
Perhaps you could show the desired output from the data sample (with an explanation of anything not obvious). I'm sure someone can help you.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |