Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I have following two tables Budgets and Years. On selected value of Years, I want to show the selected year budget in Selected Budget field.
Selected Year is Measure Field like below and it works fine.
Selected Year = SELECTEDVALUE(Years[Year]; 0)
Selected Budget is a Calculated Field like below but this doesn't work:
Selected Budget = IF([Selected Year] = 2017; Budgets[Budget 2017]; IF([Selected Year] = 2018; Budgets[Budget 2018];IF([Selected Year] = 2019; Budgets[Budget 2019]; IF([Selected Year] = 2020; Budgets[Budget 2020];IF([Selected Year] = 2021;Budgets[Budget 2021];IF([Selected Year] = 2022;Budgets[Budget 2022];0))))))
Do I need to create Measure Column instead of Calculated column? If yes, what would be the fomular?
Regards.
Aftab Ahmad
Solved! Go to Solution.
Yes, you need a measure, calculated columns are only calculated at data load and are not dynamic. You could use the same formula and just wrap a MAX around each of your Budgets[Budget 2017], etc. columns. That being said, you would have an easier time if you perhaps unpivoted your budget columns and assigned them a year, then you could do it with a FILTER statement.
Hi,
I have following two tables Budgets and Years. On selected value of Years, I want to show the selected year budget in Selected Budget field.
Selected Year is Measure Field like below and it works fine.
Selected Year = SELECTEDVALUE(Years[Year]; 0)
Selected Budget is a Calculated Field like below but this doesn't work:
Selected Budget = IF([Selected Year] = 2017; Budgets[Budget 2017]; IF([Selected Year] = 2018; Budgets[Budget 2018];IF([Selected Year] = 2019; Budgets[Budget 2019]; IF([Selected Year] = 2020; Budgets[Budget 2020];IF([Selected Year] = 2021;Budgets[Budget 2021];IF([Selected Year] = 2022;Budgets[Budget 2022];0))))))
Do I need to create Measure Column instead of Calculated column? If yes, what would be the fomular?
Regards.
Aftab Ahmad
Yes, you need a measure, calculated columns are only calculated at data load and are not dynamic. You could use the same formula and just wrap a MAX around each of your Budgets[Budget 2017], etc. columns. That being said, you would have an easier time if you perhaps unpivoted your budget columns and assigned them a year, then you could do it with a FILTER statement.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
78 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
84 | |
48 | |
48 | |
48 |