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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Learn_PBI
Frequent Visitor

Paginated Reports Query

Hello All, 

 

I have created the paginated report, and the visual is table which have columns from different tables and no aggragate column is used as columns only few stings based columns are there, when I run it, i gives 1st error as given below and second error is when i remove blank values from column it gives second error.

report buider error.pngerror 2 report builder.png

 

I am using PBI dataset as data source.
Screenshot 2023-04-19 222842.png

 

If i use the some aggregation column in the end it works.

Please guide me with this.

 

Thank you in Advance

@lbendlin @amitchandak @tamerj1 @Greg_Deckler @onurbmiguel_ 

5 REPLIES 5
Learn_PBI
Frequent Visitor

DEFINE
    VAR vFromDateTableStartofMonth1 =
        IF (
            PATHLENGTH ( @FromDateTableStartofMonth ) = 1,
            IF (
                @FromDateTableStartofMonth <> "",
                @FromDateTableStartofMonth,
                BLANK ()
            ),
            IF (
                PATHITEM (
                    @FromDateTableStartofMonth,
                    2
                ) <> "",
                PATHITEM (
                    @FromDateTableStartofMonth,
                    2
                ),
                BLANK ()
            )
        )
    VAR vFromDateTableStartofMonth1ALL =
        PATHLENGTH ( @FromDateTableStartofMonth ) > 1
            && PATHITEM (
                @FromDateTableStartofMonth,
                1,
                1
            ) < 1
    VAR vToDateTableStartofMonth1 =
        IF (
            PATHLENGTH ( @ToDateTableStartofMonth ) = 1,
            IF (
                @ToDateTableStartofMonth <> "",
                @ToDateTableStartofMonth,
                BLANK ()
            ),
            IF (
                PATHITEM (
                    @ToDateTableStartofMonth,
                    2
                ) <> "",
                PATHITEM (
                    @ToDateTableStartofMonth,
                    2
                ),
                BLANK ()
            )
        )
    VAR vToDateTableStartofMonth1ALL =
        PATHLENGTH ( @ToDateTableStartofMonth ) > 1
            && PATHITEM (
                @ToDateTableStartofMonth,
                1,
                1
            ) < 1

EVALUATE
SUMMARIZECOLUMNS (
    'ResultData'[Sample],
    'ResultData'[Date Sampled],
    'ResultData'[Sampling Point],
    'Analyte'[Analyte],
    'ResultData'[Class],
    'ResultData'[Result],
    'ResultData'[Status],
    'PRData'[PR],
    FILTER (
        VALUES ( 'DateTable'[Start of Month] ),
        (
            vFromDateTableStartofMonth1ALL
                || 'DateTable'[Start of Month]
                    >= DATEVALUE ( vFromDateTableStartofMonth1 )
                        + TIMEVALUE ( vFromDateTableStartofMonth1 )
        )
            && (
                vToDateTableStartofMonth1ALL
                    || 'DateTable'[Start of Month]
                        <= DATEVALUE ( vToDateTableStartofMonth1 )
                            + TIMEVALUE ( vToDateTableStartofMonth1 )
            )
    ),
    RSCUSTOMDAXFILTER (
        @SiteDEPT,
        EqualToCondition,
        [Site].[DEPT],
        String
    ),
    "TotalSamples", [TotalSamples]
)

d_gosbell
Super User
Super User


@Learn_PBI wrote:

If i use the some aggregation column in the end it works.

 


If you are pulling in columns from multiple tables you should always include a measure otherwise you will just get a crossjoin of every possible combination of all the values which is not typically. You don't need to include the measure in your visualization, but having it in the query will allow the engine to correctly resolve the joins between the various tables.

I tried using a measure at the end in dataset, still same 2nd error

Can you try limiting the amout of data, put a Top N clause to see if this is because you are pulling too much data with your query? Also, you might have more information in the log file that could help diagnose. The file is at C:\Users\(you)\AppData\Local\Microsoft\Power BI Report Builder\15.7\Traces

This is the code which got generated with in-built functions, I tried using top N, but the query is not getting validated.

Please guide me if i am missing anything.

DEFINE
    VAR vFromDateTableStartofMonth1 =
        IF (
            PATHLENGTH ( @FromDateTableStartofMonth ) = 1,
            IF (
                @FromDateTableStartofMonth <> "",
                @FromDateTableStartofMonth,
                BLANK ()
            ),
            IF (
                PATHITEM (
                    @FromDateTableStartofMonth,
                    2
                ) <> "",
                PATHITEM (
                    @FromDateTableStartofMonth,
                    2
                ),
                BLANK ()
            )
        )
    VAR vFromDateTableStartofMonth1ALL =
        PATHLENGTH ( @FromDateTableStartofMonth ) > 1
            && PATHITEM (
                @FromDateTableStartofMonth,
                1,
                1
            ) < 1
    VAR vToDateTableStartofMonth1 =
        IF (
            PATHLENGTH ( @ToDateTableStartofMonth ) = 1,
            IF (
                @ToDateTableStartofMonth <> "",
                @ToDateTableStartofMonth,
                BLANK ()
            ),
            IF (
                PATHITEM (
                    @ToDateTableStartofMonth,
                    2
                ) <> "",
                PATHITEM (
                    @ToDateTableStartofMonth,
                    2
                ),
                BLANK ()
            )
        )
    VAR vToDateTableStartofMonth1ALL =
        PATHLENGTH ( @ToDateTableStartofMonth ) > 1
            && PATHITEM (
                @ToDateTableStartofMonth,
                1,
                1
            ) < 1

EVALUATE
SUMMARIZECOLUMNS (
    'ResultData'[Sample],
    'ResultData'[Date Sampled],
    'ResultData'[Sampling Point],
    'Analyte'[Analyte],
    'ResultData'[Class],
    'ResultData'[Result],
    'ResultData'[Status],
    'PRData'[PR],
    FILTER (
        VALUES ( 'DateTable'[Start of Month] ),
        (
            vFromDateTableStartofMonth1ALL
                || 'DateTable'[Start of Month]
                    >= DATEVALUE ( vFromDateTableStartofMonth1 )
                        + TIMEVALUE ( vFromDateTableStartofMonth1 )
        )
            && (
                vToDateTableStartofMonth1ALL
                    || 'DateTable'[Start of Month]
                        <= DATEVALUE ( vToDateTableStartofMonth1 )
                            + TIMEVALUE ( vToDateTableStartofMonth1 )
            )
    ),
    RSCUSTOMDAXFILTER (
        @SiteDEPT,
        EqualToCondition,
        [Site].[DEPT],
        String
    ),
    "TotalSamples", [TotalSamples]
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.