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
pratafran
Helper III
Helper III

Measure to compare actual vs capacity per Origin/Destination

Hello!,

 

I'm trying to figure out the best approach to acomplish this:

 

I have a capacity of trucks per day per facility:

FacilityCapactity
A10
B15
C8

 

And then I have a table with each individual truck executed from origin to destination and the date of execution.

 

I need to create a table comparing the actual trucks per day vs the capacity (%) per each day.

 

For acomplishing this, I did a merge of the Capacity table with a calendar table, getting for each individual day, the capacity of each facility. That table is related to a main Calendar Table, together with the actual trips table.

 

Then I created a % measure comparing actual vs capacity and I was able to put them into a table using the day of the calendar day.

 

Now I need to do the same but considering the capacity also depends on the destination:

FacilityDestinationCapactity
AX5
AY5
BZ15
CJ2
CF2
CK4

 

I want to compare the actual vs capacity on a route basis and being able to show that into a table.

 

FacilityDestinationMeasure31-Aug01-Sep02-Sep03-Sep
AXActual4355
AXCapacity5555
AX%80%60%100%100%
AYActual0045
AYCapacity5555
AY%0%0%80%100%
BZActual1081414
BZCapacity15151515
BZ%67%53%93%93%
CJActual2222
CJCapacity2222
CJ%100%100%100%100%
CFActual2222
CFCapacity2222
CF%100%100%100%100%
CKActual3323
CKCapacity4444
CK%75%75%50%75%

 

which would be the most efficient way of achieving this?

 

My two options are:

1- The merge between capacity table and the calendar table (but it creates a huge table)

2- Appending new "capacity" lines the the actual facts table per each day.

 

The capacities are fixed per combination so I'm wondering if it can be solved directly within a measure that do the job.

 

Thanks!

3 REPLIES 3
jgeddes
Super User
Super User

In my example I just created summary data to get the visual built. 

For your capacity table I would be inclined to replace the facility/capacity table you have with dates with the facility/destination/capacity table. 

That way you would still be able to sum the capacity by facility and also by destination.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





jgeddes
Super User
Super User

It is hard to say for sure without seeing how your measures are set up but assuming they calculate the required values correctly now, you should be able to adjust a matrix visual to get the result you are looking for. 

I set up a matrix with the following

jgeddes_0-1661964258900.png

Then set Values>Options>Switch values to rows = 'On'

and 

Row Headers>+/- icons = 'Off'

and 

Row Headers>Options>Stepped layout = 'Off'

to get the resulting matrix visual

jgeddes_1-1661964396776.png

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you, my main concern is how to treat the Capacity table. For the example you provided, did you did the same than I proposed of merging the calendar table with the capacity table and getting repeated the capacity per facility per single day?. Or did you managed it directly as a measure?

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.