Maximum Miles (Power BI)

cwar82

New Member
Joined
Mar 3, 2019
Messages
1
Hi - hope you can help

I have two tables.

A fact table - Table 1

BCD
DateBooking NumberPost Code
GH
DG
PH
DG
PH
SE

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]6[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]01/03/2019[/TD]
[TD="align: right"]578908[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]01/03/2019[/TD]
[TD="align: right"]578908[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]01/03/2019[/TD]
[TD="align: right"]456782[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"]02/03/2019[/TD]
[TD="align: right"]689053[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]02/03/2019[/TD]
[TD="align: right"]689053[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]02/03/2019[/TD]
[TD="align: right"]689053[/TD]

</tbody>
Sheet1



A dim table - Table 2

FG
Post CodeMiles
GH
DG
PH
SE
TS

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]6[/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]20[/TD]

[TD="align: center"]8[/TD]

[TD="align: right"]30[/TD]

[TD="align: center"]9[/TD]

[TD="align: right"]40[/TD]

[TD="align: center"]10[/TD]

[TD="align: right"]70[/TD]

[TD="align: center"]11[/TD]

[TD="align: right"]60[/TD]

</tbody>
Sheet1



They are joined together using the Post Code Column.

I'm wanting to create a measure that will display as a new column in a table visual of the fact table. I want it to look like the below:

IJKL
DateBooking NumberPost CodeMaximum Miles
GH
DG
PH
DG
PH
SE

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]6[/TD]

[TD="align: center"]7[/TD]
[TD="align: right"]01/03/2019[/TD]
[TD="align: right"]578908[/TD]

[TD="align: right"]30[/TD]

[TD="align: center"]8[/TD]
[TD="align: right"]01/03/2019[/TD]
[TD="align: right"]578908[/TD]

[TD="align: right"]30[/TD]

[TD="align: center"]9[/TD]
[TD="align: right"]01/03/2019[/TD]
[TD="align: right"]456782[/TD]

[TD="align: right"]40[/TD]

[TD="align: center"]10[/TD]
[TD="align: right"]02/03/2019[/TD]
[TD="align: right"]689053[/TD]

[TD="align: right"]70[/TD]

[TD="align: center"]11[/TD]
[TD="align: right"]02/03/2019[/TD]
[TD="align: right"]689053[/TD]

[TD="align: right"]70[/TD]

[TD="align: center"]12[/TD]
[TD="align: right"]02/03/2019[/TD]
[TD="align: right"]689053[/TD]

[TD="align: right"]70[/TD]

</tbody>
Sheet1



This column (measure) shows the maximum (highest) mileage for any given Booking Number based on the Post Codes associated with that booking. As an example booking number 689053 has three post codes associated with it - the one with the highest miles is SE at 70 miles - so in the maximum miles column it says 70 for all of the 689053 booking numbers.

Please could you help me with a measure as I'm stumped.

I hope this makes sense.

Kind regards

Chris
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,886
Messages
6,175,193
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top