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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
raymondchen
Regular Visitor

Count by month

Hi,

 

I have data like below: 

 

raymondchen_0-1668018731494.png

 

I want to create a visual on PowerBI to show the count of cases monthly, including opening balance (cases that opened in last month but not yet closed), added (cases that newly added in this month), close (cases that closed in this month), and closing balance (cases that still not closed by the end of this month). The outcome would be look like this

 

raymondchen_1-1668018923918.png

 

I just start learning DAX and have trouble of finding the correct functions to achieve.

 

I figured out of getting opening balance and added by using below: 

 

Opening Balance = CALCULATE(DISTINCTCOUNT('Table'[Case #]), PARALLELPERIOD('Table'[Date Reported].[Date], -1, MONTH))

Added = CALCULATE(DISTINCTCOUNT('Table'[Case #]), PARALLELPERIOD('Table'[Date Reported].[Date], 0, MONTH))

 

However, I cannot get the Closed and Closing Balance

 

Thank you for the help in advance.

 

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

Hi @raymondchen ,

 

Like this?

vmengzhumsft_0-1669098058354.png

Please refer to my pbix file for better understanding.

 

Best regards,

Community Support Team Selina 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-mengzhu-msft
Community Support
Community Support

Hi @raymondchen ,

 

Like this?

vmengzhumsft_0-1669098058354.png

Please refer to my pbix file for better understanding.

 

Best regards,

Community Support Team Selina zhu

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

Sandielly
Frequent Visitor

Hey, try to create a column in PQ with dates between Start and End date, then link your calendar table with this new created column, your model will be bigger but you will have a record for each day and you can count them afterwards.

Sorry I am not quite understand. What do you mean by Start and End date? And how to get the count by linking to calendar table? 

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors