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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jnpb
Helper I
Helper I

Line chart not displaying correctly - help!

Hi all,

I've been fighting with a line chart visual for two weeks and am entirely confounded as to what the problem is with the results. The goal is: show the cumulative number of event registrations for 2023 (all) and 2024 (YTD) so that we can analyize our performance vs last year.

After taking feedback from my previous attempt, I have:

-Created a consolidated view in the database that contains all of the event registrations for multiple years (2023, 2024) and includes the dates.
- Created a date table

I've setup the line visual in the following way:

X-Axis: MonthName (January-December)
Y-Axis: Cumulative Registration Measure (shown below)
Legend: Year

The measure in the Y-Axis is:

Cumulative Registration =

VAR SelectedProgram = SELECTEDVALUE('DailyRegistrationCount'[Program])

RETURN

IF(

SelectedProgram = "Swim",

CALCULATE([Weekly Cumulative Registration], 'DateTable'[Month] <= 12), // January to December

[Weekly Cumulative Registration] // Full Year

)

The line for 2023 shows correctly (cumulatively), but the line for 2024 - despite having data and the value reporting correctly, shows a flat trend line that extends across Jan-Dec despite it only being January 13.

This is the current, output that displays incorrectly:

Screenshot 2024-01-13 093210.png

 

I'm losing my darned mind! What am I doing incorreectly that is causing the line to extend past the current date and also be flat? Any insight you have would be immensely appreciated.

Thank you!

1 ACCEPTED SOLUTION

@jnpb 

I have modifed your measure, please try:

Cumulative Registration =
VAR SelectedProgram =
    SELECTEDVALUE ( 'DailyRegistrationCount'[Program] )
RETURN
    IF (
        SelectedProgram = "Swim"
            && NOT ISBLANK ( SUM('DailyRegistrationCount'[RegistrationCount]) ),
        [Weekly Cumulative Registration]
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


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

@jnpb 

since you have the year in the legend, the measure should be as follows:

 

Cumulative Registration =
VAR SelectedProgram =
    SELECTEDVALUE ( 'DailyRegistrationCount'[Program] )
RETURN
    IF (
        SelectedProgram = "Swim"
            && NOT ISBLANK ( [Sum of Registration Measure] ),
        [Weekly Cumulative Registration]
    )


Or, If you want restrict the cumulative sum being shown where there is not data try this:




 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

I'm a bit confused by the [Sum of Registration Measure] part. This is what I have as my 'Weekly Cumulative Registration' measure: 

Weekly Cumulative Registration =
CALCULATE (
    SUM('DailyRegistrationCount'[RegistrationCount]),
    FILTER (
        ALL('DateTable'),
        'DateTable'[Year] = MAX('DateTable'[Year]) &&
        'DateTable'[WeekOfYear] <= MAX('DateTable'[WeekOfYear])
    )
)

@jnpb 

I have modifed your measure, please try:

Cumulative Registration =
VAR SelectedProgram =
    SELECTEDVALUE ( 'DailyRegistrationCount'[Program] )
RETURN
    IF (
        SelectedProgram = "Swim"
            && NOT ISBLANK ( SUM('DailyRegistrationCount'[RegistrationCount]) ),
        [Weekly Cumulative Registration]
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.