DAX measure to bring value from one side to many

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
To try this I just created a fact table ; sales id , customer , item , sales, and a dim ; customer , customer id,

and I want to bring the customer id to the sales fact table ; as a calculated column i did this two ways ,

Excel Formula:
MAXX( RELATEDTABLE(Customer),Customer[Id])
as the id is just number I used maxx but i don't think this is a very good way just the best i could think of.
and second ;
Excel Formula:
 LOOKUPVALUE( Customer[Id],Customer[Customer],Sales[Customer])

What I've been trying to do is write a measure to do the same, so I have a pivot with the sales id, sales, and I want a measur that would give me the
id from the customer table id.
if it helps i've put the file on onedrive.


Richard
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I have since used the following

Excel Formula:
CALCULATE( MAXX(Customer, Customer[Id]),Sales)

which works, but im not sure if it's a good way and it still relies on MAXX and think there may be a better function to
bring back the value.

Richad.
 
Upvote 0
For a calculated column, I'd just use:

Excel Formula:
= RELATED(Customer[Id])

I can't conceive of why you would ever need it as a measure. It makes no sense.
 
Upvote 1
Solution

Forum statistics

Threads
1,223,248
Messages
6,171,021
Members
452,374
Latest member
keccles

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