Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello everyone!
I have been trying to make this come alive in power bi.
The total value is actually the sum of receits minus debts from the year 2021. But trought measures Im not being able to sum and subract only the values of 2021, and as there is a myriad of other values inside the total summ of 2021, I have been trying to find anoter solution to this case, that is today made in excel. Does anyone have some kind of answer?
Any help is appreciated.
Solved! Go to Solution.
Hi @Pietro_Andora ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Month = FORMAT('Date'[Date],"mmmm")
2. Create measure.
Measure =
IF(
HASONEVALUE('Date'[Group]),
SUMX(FILTER(ALL('Date'),'Date'[Group]=MAX('Date'[Group])&& MONTH('Date'[Date])=MONTH(MAX('Date'[Date]))),[Amount]),
SUMX(FILTER(ALL('Date'),YEAR('Date'[Date])=2021&&MONTH('Date'[Date])=MONTH(MAX('Date'[Date]))),[Amount])
)
Total is correct =
var _table=SUMMARIZE('Date','Date'[Month],"_value",[Measure])
return
IF(HASONEVALUE('Date'[Month]),[Measure],SUMX(_table,[_value]))
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Pietro_Andora ,
I created some data:
Here are the steps you can follow:
1. Create calculated column.
Month = FORMAT('Date'[Date],"mmmm")
2. Create measure.
Measure =
IF(
HASONEVALUE('Date'[Group]),
SUMX(FILTER(ALL('Date'),'Date'[Group]=MAX('Date'[Group])&& MONTH('Date'[Date])=MONTH(MAX('Date'[Date]))),[Amount]),
SUMX(FILTER(ALL('Date'),YEAR('Date'[Date])=2021&&MONTH('Date'[Date])=MONTH(MAX('Date'[Date]))),[Amount])
)
Total is correct =
var _table=SUMMARIZE('Date','Date'[Month],"_value",[Measure])
return
IF(HASONEVALUE('Date'[Month]),[Measure],SUMX(_table,[_value]))
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
87 | |
82 | |
71 | |
49 |
User | Count |
---|---|
143 | |
124 | |
107 | |
60 | |
55 |