The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I would like to create 12 measures for the 12 months of this year in which I calculate a running total up to each end of the months.
For now I'm using this type of formula, but I would like to make it more general (not only for this year, but also for years to come):
EXAMPLE FOR JANUARY:
SP_Net amount prog Mar =
CALCULATE([SP_Net amount],
'D - Date'[Date] >= DATE ( 2021, 1, 1 ) &&
'D - Date'[Date] <= DATE ( 2021, 3, 31 ))
Hi @Anonymous ,
I'm not sure I've understood correctly what you need, but have a look at this measure:
#amt =
var monthEnd = ENDOFMONTH('Date'[Date])
var currentYear = SELECTEDVALUE('Date'[Year])
var result = CALCULATE(
[#fruits],
'Date'[Date] < monthEnd,
'Date'[Year] = currentYear
)
return
result
If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Hi, @Anonymous
I am not sure I understood your question correctly, but please try using DATESMTD or TOTALMTD function.
Something like below.
SP_Net amount prog Mar =
TOTALMTD ( 'D - Date'[Date], [SP_Net amount] )
If you can share your sample pbix file's link, then I can try to understand why you needed to write your measure like above, then I can try to come up with a more accurate measure.
Thanks.
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
I give an example:
On january I have 2 apples, on february 1 apple, on march 8 apple. So:
JANUARY FORMULA RESULT=2
FEBRUARY FORMULA RESULT= 1 + 2 =3
MARCH FORMULA RESULT= 1 + 2 + 8 = 11
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
20 | |
18 | |
17 | |
15 | |
13 |
User | Count |
---|---|
39 | |
32 | |
22 | |
19 | |
18 |