Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I am new to Power BI report building and I'm hoping you can help - I'm sure there is a simple solution but I don't know what it is!
I have a table like the one below and want to create an additional column called "ORIGINAL SOURCE" that shows the value in the SOURCE column for EVENT NO 1 in every row for the relevant REF VALUE.
REF | EVENT_NO | SOURCE |
001 | 1 | A |
001 | 2 | A |
001 | 3 | B |
001 | 4 | B |
001 | 5 | D |
002 | 1 | C |
002 | 2 | D |
002 | 3 | A |
002 | 4 | B |
002 | 5 | C |
002 | 6 | D |
So it will look like this:
REF | EVENT_NO | SOURCE | ORIGINAL SOURCE |
001 | 1 | A | A |
001 | 2 | A | A |
001 | 3 | B | A |
001 | 4 | B | A |
001 | 5 | D | A |
002 | 1 | C | C |
002 | 2 | D | C |
002 | 3 | A | C |
002 | 4 | B | C |
002 | 5 | C | C |
002 | 6 | D | C |
I would appreciate anyone's advice on the best way to achieve this.
Many Thanks,
Solved! Go to Solution.
@Green_G you can write a measure like this
Measure2 =
//what is the min event # by REF
VAR one =
CALCULATE (
MIN ( 'Table 1'[EVENT_NO] ),
ALL ( 'Table 1' ),
VALUES ( 'Table 1'[REF] )
) // what is the source when event = one by ref
VAR two =
CALCULATE (
MIN ( 'Table 1'[SOURCE] ),
FILTER (
ALL ( 'Table 1' ),
'Table 1'[EVENT_NO] = one
&& 'Table 1'[REF] = MAX ( 'Table 1'[REF] )
)
)
RETURN
two
@Green_G you can write a measure like this
Measure2 =
//what is the min event # by REF
VAR one =
CALCULATE (
MIN ( 'Table 1'[EVENT_NO] ),
ALL ( 'Table 1' ),
VALUES ( 'Table 1'[REF] )
) // what is the source when event = one by ref
VAR two =
CALCULATE (
MIN ( 'Table 1'[SOURCE] ),
FILTER (
ALL ( 'Table 1' ),
'Table 1'[EVENT_NO] = one
&& 'Table 1'[REF] = MAX ( 'Table 1'[REF] )
)
)
RETURN
two
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
11 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |