Forum Discussion

M_SBS_6's avatar
M_SBS_6
Helper V
2 years ago
Solved

Missing Date Data

Hi, 

 

I have a value for each year and month with the exception of 2 months. I have created a month on month variance calculation on my line chart however, due to these missing months, the line breaks. 

 

My measure is this - 

Prev_month = Calculate(sum(app[val], parallelperiod (app[date].[date],-1,MONTH))

 

Can I do anything to say that if a month is missing, take the last known value?  So in my case September doesn't exist so my month variance is blank but would like to to show £500 based on the difference from August. 

 

August £1,000 

September doesn't have a record 

October £1,500 (£500 increase)

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi AnalyticPulse ,

    Thank you for the quick response.

     

    Hi M_SBS_6 ,

    please have a try.

    result = 
    VAR CurrentValue = SUM(table[val])
    VAR PreviousValue = CALCULATE(SUM(table[val]), PARALLELPERIOD(table[date].[date], -1, MONTH))
    RETURN
    IF(ISBLANK(CurrentValue), PreviousValue, CurrentValue)

     

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

     

3 Replies

    • M_SBS_6's avatar
      M_SBS_6
      Helper V

      Thanks for your suggestion. I have tried this but unfortunately get an error message: 

      The true/false expression does not specify a column. Each True/false expressions used as a table filter expression must refer to exactly one column. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AnalyticPulse ,

    Thank you for the quick response.

     

    Hi M_SBS_6 ,

    please have a try.

    result = 
    VAR CurrentValue = SUM(table[val])
    VAR PreviousValue = CALCULATE(SUM(table[val]), PARALLELPERIOD(table[date].[date], -1, MONTH))
    RETURN
    IF(ISBLANK(CurrentValue), PreviousValue, CurrentValue)

     

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.