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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
91asma2
Helper I
Helper I

cumulative count with independent date tables

 
1 REPLY 1
Anonymous
Not applicable

These measures are the best I can do with the limited amount of info that you've given.

// If you select year-months from the two
// tables, you should never use the YearMonth
// field from 'Date' in the UI. This column
// should be hidden.

[Measure] =
var YearMonthStart =
    SELECTEDVALUE( StartDate[StartYearMonth]
var YearMonthEnd = 
    SELECTEDVALUE( EndDate[EndYearMonth]
var Result =
    CALCULATE(
        [Measure1],
        KEEPFILTERS( 
            'Date'[YearMonth] >= YearMonthStart ),
        KEEPFILTERS(
            'Date'[YearMonth] <= YearMonthEnd )
    )
RETURN
    Result
    
    
[Cumulative Registration] =
var MaxVisibleDate = MAX('Date'[Date] )
var Result =
    CALCULATE(
        CALCULATE(
            DISTINCTCOUNT( User[UserID] ),
            KEEPFILTERS( 
                'Date'[YearMonth] >= YearMonthStart ),
            KEEPFILTERS(
                'Date'[YearMonth] <= YearMonthEnd ),
            KEEPFILTERS( 
                'Date'[Date] <= MaxVisibleDate )
        ),
        ALLSELECTED( 'Date' )
    )
RETURN
    Result

 

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.