Forum Discussion
Anonymous
8 years agoNot applicable
Filter values x-axis dynamically
Hi! I created a monthly percent difference chart using Power BI's quick measure, month-over-month change. My problem is the value for the next month (-100%) always appear in the chart. I only want up...
- 8 years ago
Anonymous
I Answer in PM. The answer to avoid this is:
Cost MoM% = IF(MAX('Table1'[Date_new])<>BLANK(); IF( ISFILTERED('Table1'[Date_new]); ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."); VAR __PREV_MONTH = CALCULATE( SUM('Table1'[Cost]); DATEADD('Table1'[Date_new].[Date]; -1; MONTH) ) RETURN DIVIDE(SUM('Table1'[Cost]) - __PREV_MONTH; __PREV_MONTH) ))
Vvelarde
8 years agoCommunity Champion
Anonymous
I Answer in PM. The answer to avoid this is:
Cost MoM% =
IF(MAX('Table1'[Date_new])<>BLANK();
IF(
ISFILTERED('Table1'[Date_new]);
ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column.");
VAR __PREV_MONTH =
CALCULATE(
SUM('Table1'[Cost]);
DATEADD('Table1'[Date_new].[Date]; -1; MONTH)
)
RETURN
DIVIDE(SUM('Table1'[Cost]) - __PREV_MONTH; __PREV_MONTH)
))
Anonymous
8 years agoNot applicable