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
TDisco
Helper I
Helper I

Cumulative Count in Line Graph

Having a issue I can't search a solution for. I've tried others, but I just can't make this work.

 

I have a single Table that contains each time a user logs in. I want to have a yearly cumalitve total on a graph. I can't get them to display over each other - just side-by-side. (when by month)

 

TDisco_0-1669052889226.png

I started with an ALL Cumulative measure--- this works great and restarts at the YEAR mark.

m_LoginsCountYTDAll =
CALCULATE (
    COUNT('tbl_Logins'[UserName] ),
    FILTER (
        ALL ( 'Date' ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
            && 'Date'[Year] = MAX ( 'Date'[Year] )
    )
)
 

I have two measures that divide the counts into two years.

m_LoginsCount2021 = CALCULATE([m_LoginsCountAll], 'Date'[Year] = 2021)
m_LoginsCount2022 = CALCULATE([m_LoginsCountAll], 'Date'[Year] = 2022)
 

Then I have these to get me a cumulative total.

2021

m_LoginsCountYTD2021 =
IF([m_LoginsCount2021] <> 0,
CALCULATE (
    [m_LoginsCount2021],
    FILTER (
        ALLSELECTED ( 'Date' ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
            && 'Date'[Year] = MAX ( 'Date'[Year] )
    )
), "")
 
2022
m_LoginsCountYTD2022 =
IF([m_LoginsCount2022] <> 0,
CALCULATE (
    [m_LoginsCount2021],
    FILTER (
        ALLSELECTED ( 'Date' ),
        'Date'[Date] <= MAX ( 'Date'[Date] )
            && 'Date'[Year] = MAX ( 'Date'[Year] )
    )
), "")
 
All of this works great in a table. When I graph it, it either gives me the above screen shot when by month, or it divides it by year, when I add the year (and month).
TDisco_1-1669053258906.png

 

 

How do I get them to share the same month on the graph (overlap the year)

I'm so close - just missing the mark. Thank you in advance.

1 ACCEPTED SOLUTION
TDisco
Helper I
Helper I
3 REPLIES 3
TDisco
Helper I
Helper I

Shaurya
Memorable Member
Memorable Member

Hi @TDisco,

 

Why don't you try creating a table just a list of month names and number, no year or date column. Join the month number from this new table to the month number in the date table and use month name as X-Axis in your visuals.

 

Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI

No-go, but thank you

(not sorted - but still, same response)

TDisco_0-1669064224498.png

 

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!

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