Forum Discussion

PriyankaA905's avatar
PriyankaA905
Frequent Visitor
4 years ago
Solved

Maximum allowed size of 1000000 rows

Hi,

I have to prepare the following Lag report

In above case, in January 2022,13413 number of accounts opened. In following months there is a count of A/cs which are not closed for eg As on 28 feb 22, 3 accounts were closed so the no. of accounts active are 13410. To acheive this I have 3 measures

Account opened in Cust Dim =
Var monthafter = SELECTEDVALUE(Series[Series])
Var Currentfirstopeningmonth =SELECTEDVALUE('Customer Detail'[Lag_opening date])
return
CALCULATE(
DISTINCTCOUNT('Customer Detail'[ACNTS_INTERNAL_ACNUM]),
FILTER('Customer Detail',
EOMONTH('Customer Detail'[ACNTS_OPENING_DATE],0)=EOMONTH(Currentfirstopeningmonth,monthafter)
)
)

Account closed in Cust dim =
var as_on_date = SELECTEDVALUE(Date_DIM[AS_ON_DATE])
return
CALCULATE(
DISTINCTCOUNT('Customer Detail'[ACNTS_INTERNAL_ACNUM]),'Customer Detail'[ACNTS_CLOSURE_DATE]<>BLANK(),
FILTER('Customer Detail',
EOMONTH('Customer Detail'[ACNTS_CLOSURE_DATE],0)<=EOMONTH(as_on_date,0)
))


lag reort=
Var A = SELECTEDVALUE(Date_DIM[AS_ON_DATE])
return
CALCULATE([Account opened in Cust Dim]-[Account closed in Cust dim],
filter(
'Customer Detail',
SELECTEDVALUE('Customer Detail'[Lag_opening date])<=A))
 
In Matrix table
Rows= Account Opening Month and Year (Customer Dim)
Columns = As on Date (Date Dim Table)
Values = Lag Report measure


In above case,I have filtered only one product code hence the measure is running properly but when I use all the products it is giving the following error

How can I solve this error?

 

  • Hi PriyankaA905 ,


    The reason for such error messages is that Power BI creates queries as efficiently as possible. However, in some cases, the generated queries may not be efficient enough to avoid refresh failures. One such case is when the generated query retrieves too many rows (more than 1 million rows) from the back-end data source, the following error will occur.

    The resultset of a query to external data source has exceeded
    the maximum allowed size of '1000000' rows.

     

    related document link.

    Use DirectQuery in Power BI Desktop - Power BI | Microsoft Docs


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


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

2 Replies

  • PriyankaA905's avatar
    PriyankaA905
    Frequent Visitor

    I am attaching sample Data here:

    Customer Dim:

    ACNTS_INTERNAL_ACNUMACNTS_OPENING_DATEACNTS_CLOSURE_DATELag_opening date
    11-Jan-22 Jan-22
    21-Jan-22 Jan-22
    33-Jan-22 Jan-22
    43-Jan-22 Jan-22
    53-Jan-2218-Jan-22Jan-22
    63-Jan-222-Mar-22Jan-22
    73-Jan-227-Mar-22Jan-22
    83-Jan-2216-Mar-22Jan-22
    93-Jan-2213-Apr-22Jan-22
    104-Jan-22 Jan-22
    114-Jan-22 Jan-22
    124-Jan-2215-Jan-22Jan-22
    134-Jan-228-Mar-22Jan-22
    144-Jan-2212-Apr-22Jan-22
    165-Jan-22 Jan-22
    176-Jan-22 Jan-22
    186-Jan-22 Jan-22
    207-Jan-22 Jan-22
    218-Jan-22 Jan-22
    228-Jan-22 Jan-22
    2310-Jan-22 Jan-22
    2510-Jan-2211-Mar-22Jan-22
    2611-Jan-22 Jan-22
    2812-Jan-22 Jan-22
    2912-Jan-22 Jan-22
    3112-Jan-2228-Jan-22Jan-22
    3212-Jan-2216-Mar-22Jan-22
    3312-Jan-2227-Apr-22Jan-22
    3413-Jan-22 Jan-22
    3614-Jan-22 Jan-22
    3714-Jan-22 Jan-22
    3915-Jan-22 Jan-22
    4016-Jan-22 Jan-22
    4116-Jan-22 Jan-22
    4217-Jan-22 Jan-22
    4418-Jan-22 Jan-22
    4518-Jan-22 Jan-22
    4618-Jan-2224-Mar-22Jan-22
    4719-Jan-22 Jan-22
    4819-Jan-22 Jan-22
    5020-Jan-22 Jan-22
    5121-Jan-22 Jan-22
    5321-Jan-227-Apr-22Jan-22
    5422-Jan-22 Jan-22
    5624-Jan-22 Jan-22
    5824-Jan-222-Feb-22Jan-22
    5925-Jan-22 Jan-22
    6025-Jan-22 Jan-22
    6125-Jan-222-May-22Jan-22
    6226-Jan-22 Jan-22
    6326-Jan-22 Jan-22
    6427-Jan-22 Jan-22
    6527-Jan-22 Jan-22
    6627-Jan-2227-Jan-22Jan-22
    6728-Jan-22 Jan-22
    6828-Jan-22 Jan-22
    6928-Jan-2230-Apr-22Jan-22
    7029-Jan-22 Jan-22
    7129-Jan-22 Jan-22
    7229-Jan-2211-Feb-22Jan-22
    7329-Jan-2225-Feb-22Jan-22
    7429-Jan-228-Apr-22Jan-22
    7530-Jan-22 Jan-22
    7630-Jan-22 Jan-22
    7731-Jan-22 Jan-22
    7831-Jan-22 Jan-22
    801-Feb-22 Feb-22
    811-Feb-2211-Feb-22Feb-22
    821-Feb-2221-Mar-22Feb-22
    831-Feb-2213-Apr-22Feb-22
    842-Feb-22 Feb-22
    852-Feb-22 Feb-22
    863-Feb-22 Feb-22
    873-Feb-22 Feb-22
    894-Feb-22 Feb-22
    904-Feb-225-Mar-22Feb-22
    914-Feb-2231-Mar-22Feb-22
    924-Feb-224-May-22Feb-22
    935-Feb-22 Feb-22
    945-Feb-22 Feb-22
    976-Feb-22 Feb-22
    987-Feb-22 Feb-22
    997-Feb-22 Feb-22
    1007-Feb-227-Feb-22Feb-22
    1018-Feb-22 Feb-22
    1028-Feb-22 Feb-22
    1038-Feb-222-Mar-22Feb-22
    1048-Feb-223-Mar-22Feb-22
    1059-Feb-22 Feb-22
    1069-Feb-22 Feb-22
    10710-Feb-22 Feb-22
    10810-Feb-22 Feb-22
    10911-Feb-22 Feb-22
    11011-Feb-22 Feb-22
    11111-Feb-2221-Mar-22Feb-22
    11212-Feb-22 Feb-22
    11312-Feb-22 Feb-22
    11414-Feb-22 Feb-22
    11514-Feb-22 Feb-22
    11615-Feb-22 Feb-22
    11715-Feb-22 Feb-22
    11915-Feb-2230-Apr-22Feb-22
    12016-Feb-22 Feb-22
    12116-Feb-22 Feb-22
    12216-Feb-2225-Apr-22Feb-22
    12317-Feb-22 Feb-22
    12417-Feb-22 Feb-22
    12517-Feb-2212-Apr-22Feb-22
    12618-Feb-22 Feb-22
    12718-Feb-22 Feb-22
    12818-Feb-2230-Mar-22Feb-22
    12919-Feb-22 Feb-22
    13019-Feb-22 Feb-22
    13120-Feb-22 Feb-22
    13220-Feb-22 Feb-22
    13321-Feb-22 Feb-22
    13421-Feb-22 Feb-22
    13522-Feb-22 Feb-22
    13622-Feb-22 Feb-22
    13723-Feb-22 Feb-22
    13823-Feb-22 Feb-22
    13924-Feb-22 Feb-22
    14024-Feb-22 Feb-22
    14124-Feb-2218-Apr-22Feb-22
    14224-Feb-224-May-22Feb-22
    14325-Feb-22 Feb-22
    14425-Feb-22 Feb-22
    14526-Feb-22 Feb-22
    14626-Feb-22 Feb-22
    14728-Feb-22 Feb-22
    14828-Feb-22 Feb-22
    14928-Feb-228-Apr-22Feb-22
    15028-Feb-2228-Apr-22Feb-22
    1511-Mar-22 Mar-22
    1521-Mar-22 Mar-22
    1532-Mar-22 Mar-22
    1542-Mar-22 Mar-22
    1553-Mar-22 Mar-22
    1563-Mar-22 Mar-22
    1573-Mar-228-Apr-22Mar-22
    1584-Mar-22 Mar-22
    1594-Mar-22 Mar-22
    1605-Mar-22 Mar-22
    1615-Mar-22 Mar-22
    1625-Mar-2223-Mar-22Mar-22
    1636-Mar-22 Mar-22
    1646-Mar-22 Mar-22
    1657-Mar-22 Mar-22
    1667-Mar-22 Mar-22
    1677-Mar-2216-Mar-22Mar-22
    1688-Mar-22 Mar-22
    1698-Mar-22 Mar-22
    1708-Mar-2211-Apr-22Mar-22
    1719-Mar-22 Mar-22
    1729-Mar-22 Mar-22
    1739-Mar-2226-Apr-22Mar-22
    17410-Mar-22 Mar-22
    17510-Mar-22 Mar-22
    17610-Mar-2216-Apr-22Mar-22
    17711-Mar-22 Mar-22
    17811-Mar-22 Mar-22
    17911-Mar-222-Apr-22Mar-22
    18012-Mar-22 Mar-22
    18112-Mar-22 Mar-22
    18212-Mar-2216-Apr-22Mar-22
    18312-Mar-224-May-22Mar-22
    18413-Mar-22 Mar-22
    18514-Mar-22 Mar-22
    18614-Mar-22 Mar-22
    18714-Mar-2216-Mar-22Mar-22
    18815-Mar-22 Mar-22
    18915-Mar-22 Mar-22
    19016-Mar-22 Mar-22
    19116-Mar-22 Mar-22
    19217-Mar-22 Mar-22
    19317-Mar-22 Mar-22
    19417-Mar-2213-Apr-22Mar-22
    19518-Mar-22 Mar-22
    19618-Mar-22 Mar-22
    19719-Mar-22 Mar-22
    19819-Mar-22 Mar-22
    19921-Mar-22 Mar-22
    20021-Mar-22 Mar-22
    20122-Mar-22 Mar-22
    20222-Mar-22 Mar-22
    20322-Mar-2222-Mar-22Mar-22
    20423-Mar-22 Mar-22
    20523-Mar-22 Mar-22
    20623-Mar-2223-Mar-22Mar-22
    20723-Mar-2228-Mar-22Mar-22
    20823-Mar-225-Apr-22Mar-22
    20924-Mar-22 Mar-22
    21024-Mar-22 Mar-22
    21124-Mar-2221-Apr-22Mar-22
    21225-Mar-22 Mar-22
    21325-Mar-22 Mar-22
    21426-Mar-22 Mar-22
    21526-Mar-22 Mar-22
    21626-Mar-224-May-22Mar-22
    21727-Mar-22 Mar-22
    21827-Mar-22 Mar-22
    21928-Mar-22 Mar-22
    22028-Mar-22 Mar-22
    22129-Mar-22 Mar-22
    22229-Mar-22 Mar-22
    22329-Mar-2216-Apr-22Mar-22
    22429-Mar-2227-Apr-22Mar-22
    22530-Mar-22 Mar-22
    22630-Mar-22 Mar-22
    22731-Mar-22 Mar-22
    22831-Mar-22 Mar-22

    Date Dim:

    AS_ON_DATE
    31-Jan-22
    28-Feb-22
    31-Mar-22
    30-Apr-22
  • v-henryk-mstf's avatar
    v-henryk-mstf
    Icon for Community Support rankCommunity Support

    Hi PriyankaA905 ,


    The reason for such error messages is that Power BI creates queries as efficiently as possible. However, in some cases, the generated queries may not be efficient enough to avoid refresh failures. One such case is when the generated query retrieves too many rows (more than 1 million rows) from the back-end data source, the following error will occur.

    The resultset of a query to external data source has exceeded
    the maximum allowed size of '1000000' rows.

     

    related document link.

    Use DirectQuery in Power BI Desktop - Power BI | Microsoft Docs


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


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