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
I have a fact table showing direct and indirect costs by year.
e.g. each project can have direct and inidrect costs for each year of the project.
Some projects may be 2 years, some may be 5 years in length.
I am trying to calculate total costs (sum of direct and indirect, excluding the year), but for the year, teh year in the column header is adding columns for all years, even if the select project only has a small number of years.
In this example proj a has 2 years, but when i do my total cost calculation, the matrix adds a column for all years.
e.g. for proj a there should be year 1 & year 2 total costs, direct and indirect, but im seeing 7 years of them as another project has 7 years.
The pic below shows what i want to get (1st table) and what i actually get (2nd table)
Appreciate any help. An example pbix is located here
https://1drv.ms/u/s!AgldA0VQfPV9hNBEkjNN5mdorq779A
Solved! Go to Solution.
You may add IF.
IF (
HASONEVALUE ( factBudgets[Year] ),
You may add IF.
IF (
HASONEVALUE ( factBudgets[Year] ),
Thank you, that works!
I dont undetstand how it works however, could i trouble you for an explination?
Also, although it was not a requirement, the measure now only works on the matrix now, it wont work on a table, is it a case i need a seperate measure for a table and for a matrix in this situation?
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 |
|---|---|
| 36 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |