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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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