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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

I need help

Hello!

I have a database containing student enrolments, the dates of which range from June to October 2021 and May to July 2022.

To do this, I need to calculate the accumulated of these registrations per year and also make a graph of lines to compare the accumulated of both years.

I have tried every possible formula, but nothing is working for me.

I would appreciate your help!!

Best regards

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

1 create a model like the following( add a calendar table for the fact table):

vchenwuzmsft_0-1658226555089.png

 

2 create a measure via:

Measure = 
calculate(DISTINCTCOUNT('Fact table'[id]),  DATESYTD('calendar'[Date]))

 

Result:

vchenwuzmsft_1-1658226620962.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

1 create a model like the following( add a calendar table for the fact table):

vchenwuzmsft_0-1658226555089.png

 

2 create a measure via:

Measure = 
calculate(DISTINCTCOUNT('Fact table'[id]),  DATESYTD('calendar'[Date]))

 

Result:

vchenwuzmsft_1-1658226620962.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

searl
Frequent Visitor

Hello,

As long as you have a unique ID per enrolment and the enrolment date column, marked as data type 'date' and in a relationship with your date table, it should be straightforward to aggregate your enrolments as a measure in DAX;

 

                 Number of enrolments = DISTINCTCOUNTNOBLANK(Table[EnrolmentID]),
                 

 

Then with your date hierarchy - I would drag Year, then month, then date of your date table into the X axis of a line chart so that you can toggle up to Year to compare years. Drag Number of enrolments into the Y axis.

 

 

Thank you.

I did as he told me, but my problem persists.

When graphing, the gross and non-accumulated valoes appear as I need.

Also, I need the lines from both years to appear on the same chart.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.