Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Need help with Table Visualization error in PowerBI desktop

Hi everyone,

I have made a table visualization of my data for my dashboard which shows daily data, 7 days rolling average & cumulative total.

I have two tables presenting different data sets, but left table (as you can see in the pic: "Daily Fitup Inch Dia" is showing an error where it fills up empty spaces with the inital rolling average which was "5.71" in all the empty spaces. 

But the table right next to it: Daily Weld Inch Dia (with is using the exact same syntax for the measures, but ofc different data set) is displaying without errors.

 

Please help me out on how I can fix this.

  • Hi Anonymous 

     

    Your measure works well in my test, however I create another measure which could reproduce your issue. Please refer to the following image first and check the difference between them.

     

    The cause is that the dates in 'FITUP INCH DIA' table are not continuous, however dates in 'Dates' Table are continuous. When using 'FITUP INCH DIA'[Date] column in the measure, if the date does not exist in 'FITUP INCH DIA' table, then the reult of LASTDATE() will be blank as well as the DATESINPERIOD(), which makes the measure value blank. However, when using 'Dates'[Date] column in the measure, the date always exist in 'Dates' table so the  LASTDATE() and DATESINPERIOD() will not be blank, which makes the measure value not blank.

     

    Kindly let me know if this helps.

     

    Community Support Team _ Jing Zhang
    If this post helps, please consider Accept it as the solution to help other members find it.

9 Replies

  • Anonymous , Can you please highlight the error, not very clear with the screenshot.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey Amit,

    Attached screenshot showing the recurring values which aren't supposed to be filled in empty slots.

    As you can see on the right table, that error isn't happening

    • v-jingzhang's avatar
      v-jingzhang
      Community Support

      Anonymous 

      Can you please share some sample data in table format as well as the measure codes for 7 days rolling average so that I can test it further? And is there any relationship between the tables? Maybe the filters in the matrix context are different and would affect this. Thanks.

       

      Best Regards,
      Community Support Team _ Jing Zhang

  • Anonymous's avatar
    Anonymous
    Not applicable

    Syntax for Rolling Average:

    7 DAYS FITUP INCH AVG =
    CALCULATE(
    SUM('FITUP INCH DIA'[FITUP Inch DIA]),
    DATESINPERIOD(Dates[Date], LASTDATE('FITUP INCH DIA'[Date]),-7,DAY)
    )
    /7
     

     Below is some sample data from the Sheet: FITUP INCH DIA

     

    TYPEDRAWINGNUMBERSPOOLNOWELDNO/JOINTNOFITUP Inch DIASCH/WTStreamSkid BatchDate
    DUPLEX HEADERW1WRS01-BR005-0250-P3400-PERW1WRS01-BR005-0250-P3400-PER-02J-1610Sch 5S3269/17/2020
    DUPLEX HEADERW1WRS01-BR005-0250-P3400-PERW1WRS01-BR005-0250-P3400-PER-02J-1610Sch 5S3379/17/2020
    DUPLEX HEADERW1WRS01-BR005-0250-P3400-PERW1WRS01-BR005-0250-P3400-PER-02J-1610Sch 5S3489/17/2020
    DUPLEX HEADERW1WRS01-BR006-0500-P3400-PERW1WRS01-BR006-0500-P3400-PER-01J-0620Sch 5S3159/9/2020
    DUPLEX HEADERW1WRS01-BR006-0500-P3400-PERW1WRS01-BR006-0500-P3400-PER-01J-0620Sch 5S3269/9/2020
    DUPLEX HEADERW1WRS01-BR006-0500-P3400-PERW1WRS01-BR006-0500-P3400-PER-01J-0620Sch 5S3379/11/2020
    DUPLEX HEADERW1WRS01-BR006-0500-P3400-PERW1WRS01-BR006-0500-P3400-PER-01J-0620Sch 5S3489/11/2020
    DUPLEX ISOW1WRS01-BR008-0150-P3400-BRNW1WRS01-BR008-0150-P3400-BRN-0572Sch 40S31510/5/2020
    DUPLEX ISOW1WRS01-BR008-0150-P3400-BRNW1WRS01-BR008-0150-P3400-BRN-0582Sch 40S31510/5/2020
    DUPLEX ISOW1WRS01-BR008-0150-P3400-BRNW1WRS01-BR008-0150-P3400-BRN-0592Sch 40S31510/5/2020
    DUPLEX ISOW1WRS01-BR008-0150-P3400-BRNW1WRS01-BR008-0150-P3400-BRN-05102Sch 40S31510/5/2020
    DUPLEX ISOW1WRS01-BR008-0150-P3400-BRNW1WRS01-BR008-0150-P3400-BRN-06112Sch 40S31510/5/2020
      • v-jingzhang's avatar
        v-jingzhang
        Community Support

        Hi Anonymous 

         

        Your measure works well in my test, however I create another measure which could reproduce your issue. Please refer to the following image first and check the difference between them.

         

        The cause is that the dates in 'FITUP INCH DIA' table are not continuous, however dates in 'Dates' Table are continuous. When using 'FITUP INCH DIA'[Date] column in the measure, if the date does not exist in 'FITUP INCH DIA' table, then the reult of LASTDATE() will be blank as well as the DATESINPERIOD(), which makes the measure value blank. However, when using 'Dates'[Date] column in the measure, the date always exist in 'Dates' table so the  LASTDATE() and DATESINPERIOD() will not be blank, which makes the measure value not blank.

         

        Kindly let me know if this helps.

         

        Community Support Team _ Jing Zhang
        If this post helps, please consider Accept it as the solution to help other members find it.