Forum Discussion
Remove future values but keep months on x axis
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
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:
- Anonymous2 years agoNot applicable
Hi ArchStanton ,
According to the screenshot, it seems that the condition "MAX ( Date2[MonthName] ) <= _Max" cause the error. Is the data type of field Date2[MonthName] Text? And the data type of field 'Cases'[Created On] is Date type. Please update the formula of measure as below:
DD YTD Cases2 = VAR _Max = MAXX ( ALLSELECTED ( 'Cases' ), 'Cases'[Created On] ) RETURN IF ( MAX ( Date2[Date] ) <= _Max, 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, the visual Fields settings 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