Forum Discussion
How to apply a different measure based on column value?
I think I have an understanding of what you're trying to do, just need a little more info.
What is the [Supply] measure?
It would help to have some sample data from the demand table if possible.
A part of the Demand table looks like this:
| Office | Date | Needed |
| A | 03/11/2023 | 5 |
| B | 03/09/2023 | 4 |
| A | 03/09/2023 | 6 |
| C | 03/06/2023 | 4 |
| B | 03/07/2023 | 6 |
| A | 03/13/2023 | 7 |
So the Demand is just summing the 'Needed' column for each office in this Demand table. I Have this connected to my office table on the Office column.
The [Supply] measure if similar but is working on the 'Supply' table.
A snippet of the Supply table:
| Item | ItemCreationDate | Office |
| 1111 | [Some Date] | A |
| 1112 | [Some Date] | B |
| 1113 | [Some Date] | C |
| 1114 | [Some Date] | A |
| 1115 | [Some Date] | C |
So the [Supply] measure is just supposed to do a count(Item) for each office basically. So in this snippet, Office A would have the value 2, B=1 and c=2. I have this Supply table connected to my original office table on the 'Office' column.
Thanks.
- KNP3 years ago
Super User
Am I correct in assuming this is your numbering for tier in the measures?
- KNP3 years ago
Super User
Above I made an assumption about the numbering of low, medium, high and added a column to the Office table in Power Query.
If this is incorrect I'll need to update.
Attached is a very basic PBIX file using your sample data, altered slightly to ensure one crosses the threshold.
Have a look and see how close the measure called 'Measure' is, to what you're looking for?