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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
vjnvinod
Impactful Individual
Impactful Individual

Dax Logic Help for cumulative on Card

 

problem statement: my actuals. measure in the table shows cumulative value, but when i place the same measure on the card, i get that individual value of the month, as you can see in Feb its 50M as cumulative value and in card it shows as 32M

 

this is my measure for cumulative value

Actual. =
IF([Actuals]>0,
CALCULATE(
    [Actuals],
    FILTER(
        ALLSELECTED('GroupOPEXCAPEX'),
        'GroupOPEXCAPEX'[DateColumn] <= MAX('GroupOPEXCAPEX'[DateColumn]) &&
        'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
    )),BLANK()
)

 

this is my measure for month on month Actuals

Actuals =
IF(
    ISBLANK(
        CALCULATE(SUM('GroupOPEXCAPEX'[Value]), 'GroupOPEXCAPEX'[Actual/Budget] = "Actuals")
    ),
    0,  // Return 0 if blank
    CALCULATE(SUM('GroupOPEXCAPEX'[Value]), 'GroupOPEXCAPEX'[Actual/Budget] = "Actuals")  // Otherwise, return the sum
)

vjnvinod_0-1733720110647.png

 

1 ACCEPTED SOLUTION
AnkitaaMishra
Super User
Super User

Hi @vjnvinod , I tried to replicate your problem statement and below formula is working for me. 

Just change the ALLSELECTED to ALL in your case.

IF([Actuals]>0,
CALCULATE(
    [Actuals],
        ALL('GroupOPEXCAPEX'),
        'GroupOPEXCAPEX'[DateColumn] <= MAX('GroupOPEXCAPEX'[DateColumn]) &&
        'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
    ),BLANK()
)
WhatsApp Image 2024-12-09 at 4.07.43 PM.jpeg

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi, @vjnvinod 

 

As @AnkitaaMishra  said, you can try the following formula.

Actual. = 
IF([Actuals]>0,
 CALCULATE([Actuals],
    FILTER( ALL('GroupOPEXCAPEX'),
        'GroupOPEXCAPEX'[DateColumn] <= MAX('GroupOPEXCAPEX'[DateColumn]) &&
        'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
    )),BLANK()
)

vzhangtinmsft_0-1733809008891.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

AnkitaaMishra
Super User
Super User

Hi @vjnvinod , I tried to replicate your problem statement and below formula is working for me. 

Just change the ALLSELECTED to ALL in your case.

IF([Actuals]>0,
CALCULATE(
    [Actuals],
        ALL('GroupOPEXCAPEX'),
        'GroupOPEXCAPEX'[DateColumn] <= MAX('GroupOPEXCAPEX'[DateColumn]) &&
        'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
    ),BLANK()
)
WhatsApp Image 2024-12-09 at 4.07.43 PM.jpeg
Sergii24
Super User
Super User

Hi @vjnvinod, I believe that the complexity of your case comes from the use of ALLSELECTED as a table function

Actual. =
IF([Actuals]>0,
CALCULATE(
[Actuals],
FILTER(
ALLSELECTED('GroupOPEXCAPEX'), //<------THE ISSUE IS HERE
'GroupOPEXCAPEX'[DateColumn] <= MAX('GroupOPEXCAPEX'[DateColumn]) &&
'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
)),BLANK()
)
 
In this video, SQLBI team explains why it's tricky and provides a good guildelines on how to use it - https://youtu.be/gD8yLTtyW1k?si=MMi05sR9PjfBV78u.
 
You don't need ALLSELECTED() to get a cummulative totals. Simply get the current max date as variable and then use it in Calculate():

Actual. =
VAR _MaxDate = MAX ('DateTable'[Date]) //MAKE SURE TO HAVE A PROPER DATE TABLE IN YOUR MODEL
RETURN
IF(
[Actuals] > 0,
CALCULATE(
[Actuals],
'DateTable'[Date]<= _MaxDate,
'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
),
BLANK()
)


This should help 🙂

anmolmalviya05
Super User
Super User

Hi @vjnvinod, Please try this:

Total Cumulative Value =
CALCULATE(
SUMX(
ALLSELECTED('GroupOPEXCAPEX'[DateColumn]),
[Actuals]
),
'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
)

@anmolmalviya05 

it doesn't work either

vjnvinod_0-1733726924835.png

 

govind_021
Super User
Super User

Hey , @vjnvinod please try this

Actuals Combined =
IF(
ISINSCOPE('GroupOPEXCAPEX'[DateColumn]),
-- Cumulative logic for table rows
IF(
[Actuals] > 0,
CALCULATE(
[Actuals],
FILTER(
ALLSELECTED('GroupOPEXCAPEX'),
'GroupOPEXCAPEX'[DateColumn] <= MAX('GroupOPEXCAPEX'[DateColumn]) &&
'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
)
),
BLANK()
),
-- Monthly value for card or other non-date visuals
CALCULATE(
SUM('GroupOPEXCAPEX'[Value]),
'GroupOPEXCAPEX'[Actual/Budget] = "Actuals"
)
)

vjnvinod
Impactful Individual
Impactful Individual

@govind_021  its returning me month on month values, not cumulative on the card

 

vjnvinod_0-1733726783112.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors