This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
* 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 May 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 |
|---|---|
| 27 | |
| 26 | |
| 22 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 21 | |
| 18 |