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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors