This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
how can I smooth string values in a column?
I have time series data (timestamp; string) with some errors or gaps in it:
timestamp;string
I would like to fill the gap and replace the error ("x") with the values in proximity (lets say we want the most frequent value looking at the last 2 and next 2 values). You could call this moving average with strings. The result in this simple example would be all "a" in the string-column.
I feel like this comes close, but MAXA does not work with strings of course:
Smooth =
CALCULATE (
CALCULATE (
MAXA( 'timeseries'[string] );
'timeseries'[Datetime]
>= VALUES ( 'timeseries'[Datetime] ) - 4 ;
'timeseries'[Datetime] <= VALUES ( 'timeseries'[Datetime] )
);
ALLEXCEPT ( 'timeseries'; 'timeseries'[Tag];'timeseries'[Logfile];'timeseries'[Datetime] )
)Any Ideas would be greatly appreciated. I was not able to find a solution.
Hi @strachi,
Can you share a complete sample please? I can't convert the "timestamp" into a time or a date.
Best Regards,
Dale
Hi @v-jiascu-msft, thanks for your reply.
In fact we can further simplify. The "timestamp" does not matter here. The first column is just to indicate the order of the timeseries data. Your can think of it as an ordered index.
Source:
timestamp;string
Result I am looking for:
timestamp;string
The "blank" and the "x" are errors to be identified by looking at the previous and following values in the series. They should be replaced by the most frequent value "in the neighbourhood".
Thank you for giving it another thought.
I am trying to use this to narrow down the strings in proximity to the data gap...
FILTER(Table1;Table1[Index]<=EARLIER(Table1[Index])+1 && Table1[Index]>=EARLIER(Table1[Index])-1)
I guess this could help me I do not succeed in putting it together in a calculated column:
Most Frequent String =
FIRSTNONBLANK (
TOPN (
1;
VALUES ( Table1[string] );
RANKX( ALL( Table1[string] ); COUNTROWS(Table1);;ASC)
);
1
)Anyone?
Hi,
how can I smooth string values in a column?
I have time series data (timestamp; string) with some errors or gaps in it:
timestamp;string
I would like to fill the gap and replace the error ("x") with the values in proximity (lets say we want the most frequent value looking at the last 2 and next 2 values). You could call this moving average with strings. The result in this simple example would be all "a" in the string-column.
I feel like this comes close, but MAXA does not work with strings of course:
Smooth =
CALCULATE (
CALCULATE (
MAXA( 'timeseries'[string] );
'timeseries'[Datetime]
>= VALUES ( 'timeseries'[Datetime] ) - 4 ;
'timeseries'[Datetime] <= VALUES ( 'timeseries'[Datetime] )
);
ALLEXCEPT ( 'timeseries'; 'timeseries'[Tag];'timeseries'[Logfile];'timeseries'[Datetime] )
)Any Ideas would be greatly appreciated. I was not able to find a solution.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 32 | |
| 31 | |
| 21 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 56 | |
| 31 | |
| 27 | |
| 22 |