Forum Discussion
Remove future values but keep months on x axis
I don't have a column called 'Case Date' so i'm not sure how to implement this?
I do have a 'Created on' date in the Cases table which I've tried using but I get this error:
DD YTD Cases2 =
VAR _Max = MAXX(ALLSELECTED('Cases'),'Cases'[Created On])
RETURN
IF(MAX(Date2[MonthName] <= _Max,
CALCULATE(
TOTALYTD(COUNT('Cases'[Case Number]),'Date2'[Date],"31/3"),BLANK())))
The Month in my x-axis comes from the Date2 calendar table and it is sorted by FYMonthNo where APR = 1st month. Created On and Date2[Date] has an active relationship in my model.
Hi ArchStanton ,
Please update the formula of measure as below and check if it can return the expected result...
DD YTD Cases2 =
VAR _Max =
MAXX ( ALLSELECTED ( 'Cases' ), 'Cases'[Created On] )
RETURN
IF (
MAX ( Date2[MonthName] ) <= _Max,
CALCULATE (
TOTALYTD ( COUNT ( 'Cases'[Case Number] ), 'Date2'[Date], "31/3" ),
BLANK ()
)
)
If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
- ArchStanton2 years ago
Power Participant
Hi _Rena
I got this error message after using your suggestion:- Anonymous2 years agoNot applicable
Hi ArchStanton ,
Thanks for your feedback. Please update the formula of measure [DD YTD Cases2] as below:
DD YTD Cases2 = VAR _Max = MAXX ( ALLSELECTED ( 'Cases' ), 'Cases'[Created On] ) RETURN IF ( MAX ( Date2[MonthName] ) <= _Max, TOTALYTD ( COUNT ( 'Cases'[Case Number] ), 'Date2'[Date], "31/3" ), BLANK () )Best Regards
- ArchStanton2 years ago
Power Participant
The formula doesn't produce any error messages anymore but when I add it to the chart I get this: