Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Hi, I am fairly new to Power BI and have a problem I cannot solve, I'm facing a problem when trying to find the vehicle data using the following table information.
I need a measure that I can get the vehicle data into the target table.
Thank you for your help.
Here is the information :
Tabel 1 | |
VehicleID | UserId |
CAR | 73e73f05 |
CAR | 634abdc1 |
BIKE | 5d2f1ebb |
BIKE | 465b85d0 |
BIKE | 3bd84da7 |
MOTORBIKE | d3ed03ad |
Table 2 | |
VehicleID | Vechicle |
BIKE | Bike |
CAR | Car |
ECAR | Electric car |
MOTORBIKE | Motorbike |
Tabel 3 | |
UserId | Vehicle |
d3ed03ad | |
5d2f1ebb | |
465b85d0 | |
73e73f05 | |
3bd84da7 | |
634abdc1 |
Here is my target :
Solved! Go to Solution.
Hi @ekor-sembilan ,
I created a sample pbix file(see the attachment), please check if that is what you want. You can create a calculated column as below in 'Table 1' to get it:
Vehicle =
CALCULATE (
MAX ( 'Table 2'[Vechicle] ),
FILTER ( 'Table 2', 'Table 2'[VehicleID] = 'Table 1'[VehicleID] )
)
Or you can create a measure as below to get it:
Measure =
VAR _selvid =
SELECTEDVALUE ( 'Table 1'[VehicleID] )
RETURN
CALCULATE (
MAX ( 'Table 2'[Vechicle] ),
FILTER ( 'Table 2', 'Table 2'[VehicleID] = _selvid )
)
Best Regards
Hi @ekor-sembilan ,
I created a sample pbix file(see the attachment), please check if that is what you want. You can create a calculated column as below in 'Table 1' to get it:
Vehicle =
CALCULATE (
MAX ( 'Table 2'[Vechicle] ),
FILTER ( 'Table 2', 'Table 2'[VehicleID] = 'Table 1'[VehicleID] )
)
Or you can create a measure as below to get it:
Measure =
VAR _selvid =
SELECTEDVALUE ( 'Table 1'[VehicleID] )
RETURN
CALCULATE (
MAX ( 'Table 2'[Vechicle] ),
FILTER ( 'Table 2', 'Table 2'[VehicleID] = _selvid )
)
Best Regards
@ekor-sembilan OK, so you can't use a measure if you want it as a calculated column in a table. Here is the calculated column form:
Column in Table 3=
VAR __UserID = [UserId]
VAR __VehicalID = MAXX(FILTER('Table 1', [UserID] = __UserID), [Vehicle])
VAR __Vehical = MAXX(FILTER('Table 2', [VehicalID] = __VehicalID), [Vehical])
RETURN
__Vehical
This assumes no relationships. If you have relationships you can probably use RELATED.
Hello Greg,
Thanks for your quick reply.
But, it's strange that the value is not the same. Here is the capture
Thanks
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |