This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
* My dax below is giving me correct row subtotal and row grand totals. BUT it is giving me incorrect column grandtotals.
* The grand totals should be the sum of the [Tonnes Actual] component up to current monthyear + [Tonnes Budget] component for future monthyear values from current monthyear value.
* Instead it is giving me only the [Tonnes Budget] values across all dates.
Please help.
Solved! Go to Solution.
I have the solution DAX below just to give closure to this thread. Thank you for your efforts.
I have the solution DAX below just to give closure to this thread. Thank you for your efforts.
HI @arnie ,
Please Try the following DAX code:
_Calc. Budget =
VAR CurrentMonthYear = VALUE(FORMAT(TODAY(), "YYYYMM"))
VAR ColumnDate = MAX('Date'[Date])
VAR ColumnMonthYear =
IF(
ISBLANK(ColumnDate),
BLANK(),
VALUE(FORMAT(ColumnDate, "YYYYMM"))
)
VAR IsGrandTotal = ISINSCOPE('Date'[Month Year]) = FALSE
VAR ActualValue =
IF(
ColumnMonthYear <= CurrentMonthYear,
[Tonnes Actual],
BLANK()
)
VAR BudgetValue =
IF(
ColumnMonthYear > CurrentMonthYear,
[Tonnes Budget],
BLANK()
)
// Correcting the Actual Total to sum up until the current month-year
VAR ActualTotal =
CALCULATE(
[Tonnes Actual],
REMOVEFILTERS('Date'),
'Date'[Month Year] <= CurrentMonthYear
)
// Correcting the Budget Total to sum from future months beyond the current month-year
VAR BudgetTotal =
CALCULATE(
[Tonnes Budget],
REMOVEFILTERS('Date'),
'Date'[Month Year] > CurrentMonthYear
)
RETURN
IF(
IsGrandTotal,
// For Grand Total: Combine the corrected Actual and Budget totals
ActualTotal + BudgetTotal,
// For individual rows, show the Actual or Budget based on the current month-year
ActualValue + BudgetValue
)
Modified version of your DAX measure:
_Calc. Budget =
VAR CurrentMonthYear = VALUE(FORMAT(TODAY(), "YYYYMM"))
VAR ColumnDate = MAX('Date'[Date])
VAR ColumnMonthYear =
IF(
ISBLANK(ColumnDate),
BLANK(),
VALUE(FORMAT(ColumnDate, "YYYYMM"))
)
VAR IsGrandTotal = ISINSCOPE('Date'[Date]) = FALSE
VAR ActualValue =
IF(
ColumnMonthYear <= CurrentMonthYear,
[Tonnes Actual],
BLANK()
)
VAR BudgetValue =
IF(
ColumnMonthYear > CurrentMonthYear,
[Tonnes Budget],
BLANK()
)
VAR ActualTotal =
CALCULATE(
[Tonnes Actual],
FILTER(
ALL('Date'),
VALUE('Date'[Month Year]) <= CurrentMonthYear
)
)
VAR BudgetTotal =
CALCULATE(
[Tonnes Budget],
FILTER(
ALL('Date'),
VALUE('Date'[Month Year]) > CurrentMonthYear
)
)
RETURN
IF(
IsGrandTotal,
ActualTotal + BudgetTotal,
ActualValue + BudgetValue
)
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
* Hi Kedar, please see my screenshots below.
* As you can see, Tonnes + Budget does add up correctly for corresponding date, but the column grand total (3rd table) is the same as the total for budget (2nd table). I need the highlighted totals for Actuals to ADD up with the budget values from Dec 24 onwards to give grand total of 364,007.
* Your solution is not adding up also, but thanks for trying.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 61 | |
| 36 | |
| 29 | |
| 22 | |
| 21 |