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, colud you help me with DAX code. I need to create new column with values from another one. I need to repleace 0 value with first value until new value is there.
Pomocny | Stlpec1 |
1000000 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
0 | 1000000 |
645826,7 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
0 | 645826,7 |
311287,1 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
0 | 311287,1 |
I tried code like tihis but it is not working.
Solved! Go to Solution.
@LuciaS1 In Power Query, add an Index column. Then you can do this. PBIX is attached below signature.
Measure =
VAR __Index = MAX('Harok1'[Index])
VAR __Value = MAX('Harok1'[Pomocny])
VAR __Result =
IF(
__Value <> 0,
__Value,
VAR __Previous = MAXX(FILTER(ALL('Harok1'), [Index] < __Index && [Pomocny] <> 0), [Index])
VAR __Result = MINX(FILTER(ALL('Harok1'), [Index] = __Previous), [Pomocny])
RETURN
__Result
)
RETURN
__Result
@LuciaS1 In Power Query, add an Index column. Then you can do this. PBIX is attached below signature.
Measure =
VAR __Index = MAX('Harok1'[Index])
VAR __Value = MAX('Harok1'[Pomocny])
VAR __Result =
IF(
__Value <> 0,
__Value,
VAR __Previous = MAXX(FILTER(ALL('Harok1'), [Index] < __Index && [Pomocny] <> 0), [Index])
VAR __Result = MINX(FILTER(ALL('Harok1'), [Index] = __Previous), [Pomocny])
RETURN
__Result
)
RETURN
__Result
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 | |
10 | |
10 | |
10 | |
10 |
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |