Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ArchStanton
Impactful Individual
Impactful Individual

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.

 

ArchStanton_0-1712651829987.png

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,

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super 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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super 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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks! this works which is great 😊

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not 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

Thank you, I think this works too, I will see what happens when this month is over and the report refreshes with May data.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors