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.
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
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |