Forum Discussion
Remove future values but keep months on x axis
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
Same 'Couldn't load data for this visual' merror message when I tried it.
- Anonymous2 years agoNot applicable
Hi ArchStanton ,
Could you please provide a simplified sample pbix file(remove the sensitive info)? Thank you.
How to upload PBI in Community
Best Regards
- ArchStanton2 years ago
Power Participant
Unfortunately I can't, this is part of a very large data model that is connected to a live Case Management System.
In the original Line & Bar Chart I posted, the black line is based on =
DD YTD Cases = CALCULATE( TOTALYTD(COUNT('Cases'[Case Number]),'Date2'[Date],"31/3"))The green bars however are not a measure, they are just a count of Ids, they are in effect showing the same thing, except the black line which is Cumulative. The Green bars stop in Sep but the Black line continues all the way to Apr. Why is it so difficult to halt the Black line on the same month when they are based on the same data?
I find DAX incredibly frustrating as the requirement here, on paper at least, sounds straightforward.
- ArchStanton2 years ago
Power Participant
HI, Can you share your pbix file please? If this is working for you then it may help me to spot any differences?
Just to reiterate, in my Date2 Calendar I have a MonthName column sorted on FYMthNumber with Apr = 1.
Hope that helps?