Forum Discussion
Line & Bar Chart
- 2 years ago
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.
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
- ArchStanton2 years agoPower 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.