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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Jatin77
Helper I
Helper I

Drill through not giving proper data after using a cumulative measure

I have a line chart visual in which i have added a cumulative count measure as mentioned below. I have another page where drill through is enabled. But when I click on certain point for cumulative number line and then do a drill through, then on drill through page it is not showing a data for cumulative number.

 

Cumulative measure dax -

Var summarytable = 

 

Addcolumns (  Allselected( datetable[dates]),

 

"K",     

 

Calculate(      

 

      Countrows(table1),      

 

     Filter (          

 

    Allselected(table1),                 'table1'[main_date]<=Max(datetable[datess) &&

 

table1[status] IN {"A","B","C","D"}

 

)

 

)

 

)

 

Var lastnonzerovalue =

 

calculate(

 

  Maxx(

 

            Filter(summarytable,[K]>0),

 

            [K]

 

)

 

 

 

Var x1 = 

 

If(

 

   Isblank(Maxx(summarytable,[K])),

 

   lastnonzerovalue,

 

   Maxx(summarytable, [K])

 

)

 

 

 

Var b = Date(2023,7,1)

 

 

 

Return

 

If

(calculate(Isblank(x1), 

 

    datetable[dates]>b), 0, x1)

 

1 REPLY 1
lbendlin
Super User
Super User

Your measure is malformed. Did you mean to write

Cumulative measure dax =
VAR summarytable =
    ADDCOLUMNS (
        ALLSELECTED ( datetable[dates] ),
        "K",
            CALCULATE (
                COUNTROWS ( table1 ),
                FILTER (
                    ALLSELECTED ( table1 ),
                    'table1'[main_date] <= MAX ( datetable[datess] )
                        && table1[status] IN { "A", "B", "C", "D" }
                )
            )
    )
VAR lastnonzerovalue =
    CALCULATE ( MAXX ( FILTER ( summarytable, [K] > 0 ), [K] ) )
VAR x1 =
    IF (
        ISBLANK ( MAXX ( summarytable, [K] ) ),
        lastnonzerovalue,
        MAXX ( summarytable, [K] )
    )
VAR b =
    DATE ( 2023, 7, 1 )
RETURN
    IF ( CALCULATE ( ISBLANK ( x1 ), datetable[dates] > b ), 0, x1 )

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.