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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
VB
Regular Visitor

How can I get a non cumulative count between dates?

Hi, I am trying to get a column that count leads between dates but not cumalative. My current output is the one of the left and I want the measure to output like the picture on the right.
VB_0-1678819439109.pngVB_1-1678819514068.png

This is my measure for the current output. 

leads per date = CALCULATE(
    COUNT('EE All Leads'[Email]),
    DATESBETWEEN(
        'Calendar'[Date],
        "07/01/2022",  
        MAX('Enrollment'[Start Date])  
    ), USERELATIONSHIP('Enrollment'[Leads Program], 'EE All Leads'[Leads Program])
)
Update to include relationships:
VB_0-1678822877340.png

The enrollemnt table is a list of everyone who signed up for an event, a leads program can have multiple events.
The EE All Leads is all the leads.
 Each page in the dashboard is a different event, filtred on the page.

This is my first time ever posting on a forum, if more information is needed let me know. 

Thank You!

8 REPLIES 8
tamerj1
Super User
Super User

Hi @VB 

please try

leads per date =
CALCULATE(
    COUNT('EE All Leads'[Email]),
    USERELATIONSHIP('Enrollment'[Leads Program], 'EE All Leads'[Leads Program])
)
VB
Regular Visitor

Thank You, with that measure this is my output. 
VB_0-1678822120620.png

 

@VB 

Please try

leads per date =
VAR CurrentStart =
MAX ( 'Enrollment'[Start Date] )
VAR PreviousStart =
CALCULATE (
MAX ( 'Enrollment'[Start Date] ),
'Enrollment'[Start Date] < CurrentStart
)
RETURN
CALCULATE (
COUNT ( 'EE All Leads'[Email] ),
USERELATIONSHIP ( 'Enrollment'[Leads Program], 'EE All Leads'[Leads Program] ),
DATESBETWEEN (
'Calendar'[Date],
COALESCE ( PreviousStart, DATE ( 2022, 7, 1 ) ),
CurrentStart
)
)

VB
Regular Visitor

Thank you @tamerj1 , I appreicate all the help! It gives me the same output as my orginal measure. This might be more complicated than I intially thought. 

VB_1-1678825345320.png

 

 

@VB 

I noticed that you are a little bit shy to explain a little bit your data model and report, therefore, I had no option but to try to guess 😅 

I understand that the date in the report is coming from Enrollment table (Start Date) and not from the date table. I can understand tgat tge problem is created due to different cardinalities between the different tables. I cannot guess enough the nature of tge relationships between the tables. A screenshot od the data model view + some sample data would greatly help to clarify the picture. 

VB
Regular Visitor

@tamerj1 Yes, it is my first time ever posting in a forum, so defently a little shy. I did create a simple dashboard with fake data to share(als found out since Im a new member I can't share it) and while doing so I realized that in that fake data dahsboard the measure works. It has the exact same relationship but less columns and less data, so something in the other columns or amount of data is causing the issue. And since I cant share the actual data, I think I'll have to figure it out on my own.
I appreicate all your help today!

@VB 

Please let me know I you need any help. 

VB
Regular Visitor

@tamerj1 I made the dummy dashboard as close as I could to the orginal and it does not work how I would like anymore. It seems to be the page filter i have for events but I need that there to distinguish between the events. If you are still willing to help me that would be great!
I included two views one with all events and programs and one with just the events from one program. It wont let me create a link to share outside my organization, so I uploaded it to google drive with the link attatched.
https://drive.google.com/file/d/11ugmXuRP_eG-3qhNzxL9XbTKUwVVrdj4/view?usp=sharing

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors