Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello dear community, how are you?
I have this case:
I need 3 DAX measurements that calculate the following for me:
I want to calculate the Total Forecast3 2021.
I want to calculate the Total Budget 2022.
And another formula that calculates the difference between Forecast3 2021 vs Budget 2022 (Budget 2022 - Forecast3 2021).
The table contains these 3 columns that are necessary for the calculation:
Also bear in mind that I already have a Total measure for each Budget and Forecasts segment.
I even leave the PBIX to you so that you can help me directly with it. I am very urgent and I will be eternally grateful to whoever helps me. Download pbix
@Greg_Deckler @CNENFRNL @Anonymous @amitchandak
Solved! Go to Solution.
Hey @Anonymous ,
the following measures should do that.
For your case 1:
Forecast3 2021 =
CALCULATE(
SUM( 'Fact_ Budget Management'[Monto USD] ),
'Fact_ Budget Management'[Tipo Opex] = "Forecast3",
YEAR( 'Fact_ Budget Management'[Fecha Reporte] ) = 2021
)
Case 2:
Total Budget 2022 =
CALCULATE(
SUM( 'Fact_ Budget Management'[Monto USD] ),
'Fact_ Budget Management'[Tipo Opex] = "Budget",
YEAR( 'Fact_ Budget Management'[Fecha Reporte] ) = 2022
)
And case 3:
Difference Forecast3 2021 vs Budget 2022 = [Forecast3 2021] - [Total Budget 2022]
Hey @Anonymous ,
the following measures should do that.
For your case 1:
Forecast3 2021 =
CALCULATE(
SUM( 'Fact_ Budget Management'[Monto USD] ),
'Fact_ Budget Management'[Tipo Opex] = "Forecast3",
YEAR( 'Fact_ Budget Management'[Fecha Reporte] ) = 2021
)
Case 2:
Total Budget 2022 =
CALCULATE(
SUM( 'Fact_ Budget Management'[Monto USD] ),
'Fact_ Budget Management'[Tipo Opex] = "Budget",
YEAR( 'Fact_ Budget Management'[Fecha Reporte] ) = 2022
)
And case 3:
Difference Forecast3 2021 vs Budget 2022 = [Forecast3 2021] - [Total Budget 2022]
Hi @Anonymous
By hard-coding the names of the years, you're shooting yourself in the foot. You'll suffer later.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |