I have created a quick measure in a qry to calculate the month over month change in printed volume. The problem I am having is that the measuer is including the current month in the calculation eventhough there is no data fro the current month.
This means that then current month is always negative and the final value is incorrect. Is there away to get the measure to exclude the current month.
Or is there away to filter a waterfall chart for the last that makes use of this sort of measure for only the previouse 12 months If I try create a realitve date filter I get the following error
Error Message:
MdxScript(Model) (15, 2) Calculation error in measure 'qryDevicePerformanceReport'[Usage MoM%]: Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.
Thanx in advance
@Vexander, try the following measure:
MoM% =
VAR vPrevMonth =
CALCULATE ( SUM ( Volume[Amount] ), DATEADD ( 'Date'[Date], -1, MONTH ) )
VAR vCurMonth =
SUM ( Volume[Amount] )
VAR vResult =
DIVIDE ( vCurMonth - vPrevMonth, vPrevMonth )
RETURN
IF ( ISBLANK ( vCurMonth ), BLANK (), vResult )
In this example, there is no data for August (current month), so there is no row for August in the table visual: