Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
BI2018No
Frequent Visitor

Mixing two time series - use forecast if measured value missing

Hello!

 

Is it possible to mix two time series from a table? One default serie is returned, but if value here is missing a value from another series is returned. Primary serie contains measured values, but sometimes one og more hourly values are missing, and we would like to use a forecasted value from another serie.

 

The new measure/column should return a value for each date. Primary value is ID1 but for the missing date value from ID2 is used.

 

IDDateValue
101.01.20181
102.01.20182
103.01.2018 Missing!
104.01.20184
105.01.20185
201.01.20186
202.01.20187
203.01.20188
204.01.20189
205.01.201810
   
New ID01.01.20181
New ID02.01.20182
New ID03.01.20188
New ID04.01.20184
New ID05.01.20185
1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @BI2018No,

 

Suppose the ID values are continual numerics in your fact dataset. 

new column =
IF (
    TableA[Value] = BLANK (),
    CALCULATE (
        FIRSTNONBLANK ( TableA[Value], 1 ),
        FILTER (
            TableA,
            TableA[ID]
                = EARLIER ( TableA[ID] ) + 1
                && TableA[Date] = EARLIER ( TableA[Date] )
        )
    ),
    TableA[Value]
)

2.PNG

 

However, if not, please add an index column in Query Editor. Then, refer to this index column rather than ID column in above formula.

1.PNG

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-yulgu-msft
Employee
Employee

Hi @BI2018No,

 

Suppose the ID values are continual numerics in your fact dataset. 

new column =
IF (
    TableA[Value] = BLANK (),
    CALCULATE (
        FIRSTNONBLANK ( TableA[Value], 1 ),
        FILTER (
            TableA,
            TableA[ID]
                = EARLIER ( TableA[ID] ) + 1
                && TableA[Date] = EARLIER ( TableA[Date] )
        )
    ),
    TableA[Value]
)

2.PNG

 

However, if not, please add an index column in Query Editor. Then, refer to this index column rather than ID column in above formula.

1.PNG

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.