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 need your helps for displaying the total sum of the booked sales in this month.
I created a Card to display total booked sales and the value of a card is changed based on MTD.
(FYI, I made a slicer for selecting the displaying month as below)
I need to get the sum of MTD sales as follows:
Total booked sales from the first date of the month to the end date of the month(i.e. from 1/1/2020 to 1/31/2020).
For example, I want to display the total sales values booked between 1/1/2020 to 1/31/2020. FYI, the below is a sales table.
Anyone can help?
Thank you,
Well, you can always do something like below. You would want to put this in some visual with your month or filter it.
MTD Measure =
VAR __Date = MAX([Booked Date])
VAR __Year = YEAR(__Date)
VAR __Month = MONTH(__Date)
VAR __FirstDate = DATE(__Year,__Month,1)
VAR __LastDate = EOMONTH(__Date,0)
RETURN
SUMX(
FILTER(
'Table',
[Booked Date] >= __FirstDate && [Booked Date] <= __LastDate
),
[Sales Value]
)
If you have Date calendar, then you can try
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-1,MONTH))))
last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |