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
TwiggyHaz
Frequent Visitor

Amend to Measure that hits 1M row count error

Hi guys!

 

Looking to see if anyone can suggest an amend to this measure I am putting together in DirectQuery Mode to stop it failling due to row limitations? The aim of the calculation is to see what the payer rate % is of a live population of accounts, where a paying account is defined as having a positive amount of collections in month (So for example if an account has two transactions in month, one for £5.00 and one for -£5.00 it is not included). Example data as follows:

 

Base Data 500k rows:
 

DebtorNo

Live DateClose Date
101/01/201801/01/2019
201/06/201801/06/2019
301/09/201801/01/9999
401/01/201901/01/9999

 

Payment Data 2.3M Rows:
 

DebtorNo

EntryDateAmount
101/01/201910
201/02/201910
301/03/201915
310/03/2019-15
410/04/201930

 

There is also a standard dates table in the model that Base Data Live/Close Dates and Payement Data Date is related to.

 

Measure used:

 

Payer Rate % = 
VAR RunningPlacedTotal =
    CALCULATE (
        COUNTA ( 'Base Data'[Live Month] ),
        FILTER (
            ALL ( 'Dates Base'[MonthName] ),
            ISONORAFTER ( 'Dates Base'[MonthName], MAX ( 'Dates Base'[MonthName] ), DESC )
        )
    )
VAR RunningCloseTotal =
    CALCULATE (
        COUNTA ( 'Base Data'[Close Month] ),
        USERELATIONSHIP ( 'Base Data'[Close Date], 'Dates Base'[DateID] ),
        FILTER (
            ALL ( 'Dates Base'[MonthName] ),
            ISONORAFTER ( 'Dates Base'[MonthName], MAX ( 'Dates Base'[MonthName] ), DESC )
        )
    )
VAR RunningLiveTotal = RunningPlacedTotal - RunningCloseTotal
VAR ActualPayersRelationship =
    CALCULATE (
        COUNTROWS (
            FILTER (
                SUMMARIZE ( Payments, Payments[DebtorNo], "Total", SUM ( Payments[Amount] ) ),
                [Total] > 0
            )
        ),
        USERELATIONSHIP ( Payments[EntryDate], 'Dates Base'[DateID] )
    )
RETURN
    DIVIDE ( ActualPayersRelationship, RunningLiveTotal, 0 )

 

The part where the measure breaks down is at the VAR = ActualPayersRelationship stage, as soon as anything more than about 10 months worth of transactions data is put through it it fails for exceeding the 1M row count limit. Is there anyway to tweak this part of the DAX to get around this issue while still getting the desired outcome whereby it doesn't error when additional data is put through it?

 

Cheers,

1 REPLY 1
v-diye-msft
Community Support
Community Support

Hi @TwiggyHaz 

 

Did you try to switch the mode to Import and keep the measure unchanged?

 

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

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.