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,
I am trying to build a report, which is showing me YTD sales until a choosen month.
In my report, I am working with two tables, which are not linked (for some reasons concerning stock figures): one with all my information, second table only with month (Jan to Dec).
Now, the user should be able to use the month slicer and choose for example july, and in the report, the July YTD Sales should occure.
I am using following measure:
Solved! Go to Solution.
@Pfoerster , do you have date or if you can create date.
date = date([year],[month],1) //month is a number
How to do when it mmm or mmmm -https://youtu.be/yPQ9UV37LOU
Time intelligence
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Hi @Pfoerster ,
Try to redo your measure to:
Actuals YTD =
(
VAR _Curr_month =
SELECTEDVALUE ( 'Monat'[Month] )
RETURN
CALCULATE (
SUM ( Combined[SalesVolume] ),
FILTER (
Combined,
Combined[Scenario] = "Actual"
&& Combined[Type] = "3rd"
&& Combined[Month] <= _Curr_month
)
)
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@Pfoerster , do you have date or if you can create date.
date = date([year],[month],1) //month is a number
How to do when it mmm or mmmm -https://youtu.be/yPQ9UV37LOU
Time intelligence
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Power BI — YTD
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Aye, perfect. That was a good advice:
I add a new column to my information table which gives me the number of Month (January = 1...). Then, I created another new measure, which transforms the selected month also into a number, and after that, the Sales Formular with <= works well. Thank you!
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 |
---|---|
100 | |
99 | |
80 | |
77 | |
66 |
User | Count |
---|---|
134 | |
106 | |
104 | |
85 | |
73 |