Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I need some hlep to calculate the total in a matrix table. When calculte each category, the condition applied is different. When calculate "SALARIES", the [Document Type] must to be "PY", for oter category, there is no such limit. I write the measure like this:
APR =
VAR CurrenPeriod = CALCULATE(MAX('Date'[Period]), 'Date'[Date]=TODAY())
VAR SalaryForecast = [Salary Filled Position]
VAR ActualValue =
IF(MAX('Rollup Master'[Rollup for Forecast Account Category])="SALARIES",
CALCULATE(SUM('G/L Account'[Amount]), 'Date'[Period]=1,'G/L Account'[Document Type]="PY"),
CALCULATE(SUM('G/L Account'[Amount]), 'Date'[Period]=1))
RETURN
IF(CurrenPeriod>1, ActualValue, SalaryForecast)
The total value 112,465 is the value without any limit. Please help how to revise the measure.
Thank you in advance!
Branko
| Rollup for Forecast Account Category | Account Rollup for Corporate Report | Sum of Amount | Document Type |
| SALARIES | Salaries | 72331 | PY |
| SALARIES | Salaries | 34727 | SA |
| SUPPLIES | Employee Travel | 3720 | AC |
| SUPPLIES | Employee Travel | -10112 | AD |
| SUPPLIES | Employee Travel | 10278 | TV |
| SUPPLIES | Contract Services | 472 | SA |
| SUPPLIES | Materials & Supplies | 100 | AC |
| SUPPLIES | Materials & Supplies | 680 | KR |
| SUPPLIES | Other | 106 | KR |
| SUPPLIES | Other | 163 | WE |
Solved! Go to Solution.
APR =
var a = SUMMARIZE('Rollup Master',[Rollup for Forecast Account Category],[Account Rollup for Corporate Report],[Document Type])
var b = ADDCOLUMNS(a, "amt",CALCULATE(sum('Rollup Master'[Amount])))
return sumx(filter(b,[Document Type]="PY" || [Rollup for Forecast Account Category]<>"SALARIES"),[amt])
Hi @brankocareer ,
Did Ibendlinreply solve your problem? If so, please mark it as the correct solution, and point out if the problem persists.
Best Regards,
Adamk Kong
APR =
var a = SUMMARIZE('Rollup Master',[Rollup for Forecast Account Category],[Account Rollup for Corporate Report],[Document Type])
var b = ADDCOLUMNS(a, "amt",CALCULATE(sum('Rollup Master'[Amount])))
return sumx(filter(b,[Document Type]="PY" || [Rollup for Forecast Account Category]<>"SALARIES"),[amt])
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 31 | |
| 20 | |
| 12 | |
| 11 |