March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
Here is a screenshot of the dashboard which is showing wrong totals :
The total in the MTD column for Feb is wrongly being calculated (the actual number if added from the base files shud be 2.8 L).
The measure is used is as follows (which btw is working perfectly for all other months ) :
The total sales is nothing but the value column summed.
The [date] column of the Date Table is linked to the Date column of the fact table and is returning the exact same number of rows as the source files.
Could there be something specific going wrong with Feb?
Any help much appreciated
Thanks
@monojchakrab , Try like
LMTD QTY forced=
Var _Maxdate = MAX('Date Table'[Date])
var _max = date(year(_Maxdate),month(_Maxdate)-1,day(_Maxdate))
return
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
//OR
//CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
//TOTALMTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
Comments are alternate options
@amitchandak - Amit, actually, surprisingly, the LMSP (last month same period), actually returns the right figure.
Its the MTD and only for the month of Feb, where there is a problem.
If there something else I need to look at? I dont think the measure is a problem as the same measures work fine for all other months.
Anyways - thank you for being in my corner
@monojchakrab , Is LMSP Value is same as Total Sales ?
if yes
Can you share calculation all related measures in tax format
@amitchandak - Amit, as for LMSP, I have tweaked the total sales figure to reflect the last month, which means for Feb, it shows Jan.
The measures used in dax format as below :
LMSP Val =
Var _Maxdate = MAX('Date Table'[Date])
Return
IF(DAY(_Maxdate)<>DAY(DATE(YEAR(_Maxdate),MONTH(_Maxdate)-1,DAY(_Maxdate))),
BLANK(),
CALCULATE(
TOTALMTD('Measures tray'[Total Sales], DATEADD('Date Table'[Date],-1,MONTH)
)
))
MTD Val =
TOTALMTD('Measures tray'[Total Sales],'Date Table'[Date])
let me know, if this helps, or if you need something more to work thru' this.
Thanks for the quick revert
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
90 | |
89 | |
85 | |
73 | |
49 |
User | Count |
---|---|
167 | |
147 | |
92 | |
70 | |
58 |