Forum Discussion
Line & Bar Chart
Hi,
I want to stop the future Cumulative line values from appearing from the line below, I only have Apr so I dont want to see future months.
The code for the line is:
DD YTD Cases = CALCULATE(
TOTALYTD(COUNT('Cases'[Case Number]),'Date2'[Date],"31/3"))
There is no code for the bar, this is just a count of ID's and so only April appears.
Lastly, I have placed a filter on the visual for FY 2024/25.
I'd be grateful for any help.
Thanks,
Hi,
Assuming the Month names on the X-axis have been dragged from the Date2 table, write this measure
Measure = if(min('Date2'[Date])>today(),blank(),[DD YTD cases])
Hope this helps.
5 Replies
- AnonymousNot applicable
Hi ArchStanton ,
Please update the formula of measure as below and check if the line and column chart can display the expected data...
DD YTD Cases = VAR _year = SELECTEDVALUE ( 'Date'[Year] ) VAR _month = SELECTEDVALUE ( 'Date'[MonthNo] ) RETURN IF ( _year <= 2023 || ( _year = 2024 && _month <= 4 ), CALCULATE ( TOTALYTD ( COUNT ( 'Cases'[Case Number] ), 'Date2'[Date], "31/3" ) ), BLANK () )If the above one can't help you figure out, please provide some raw data in your table 'Cases' (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
- ArchStantonPower Participant
Thank you, I think this works too, I will see what happens when this month is over and the report refreshes with May data.
- Ashish_MathurSuper User
Hi,
Assuming the Month names on the X-axis have been dragged from the Date2 table, write this measure
Measure = if(min('Date2'[Date])>today(),blank(),[DD YTD cases])
Hope this helps.
- ArchStantonPower Participant
Thanks! this works which is great 😊
- Ashish_MathurSuper User
You are welcome.