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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
username2
Frequent Visitor

How to calculate previous months based on current month measures

Hi Community

 

I have a matrix visual and there's one metric I can't figure out how to calculate. It's Outstanding

Metric2022 082022 092022 10
Open105110115
Closed100105110
Outstanding190195200

 

Current month's Outstanding is easy, but for this particular report calculating previous months is the difficult part.

To calculate previous month's outstanding (2022 09) I need to add Outstanding + Open - Closed for 2022 10, for 2022 08 I need to add Outstanding + Open - Closed for 2022 09 and so on.

I can achieve this in Excel easily, I just can't translate it to PBI.

Any advise would be appreciated.

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
username2
Frequent Visitor

I don't seem to be able to attach a file here.

 

The raw data look like this, I only included the columns that are used to calculate values in the table I included in my original message:

 

Data SetKeyStatusDate
Open110B  2523_2Closed2022/10
Closed110D 80082_2Open2022/09
Closed110G  2671_2Open2022/09
Closed110G  4440_2Open2022/09
Closed112C   103_2Open2022/09
Closed112W   954_2Open2022/09
Closed112W  1149_2Open2022/11
Closed113J     2_2Open2022/11
Closed113W   221_2Open2022/11
Open114A 82006_2Closed2022/11
Open114A 82010_2Closed2022/11
Open114W    59_2Closed2022/11
Open114W    82_2Closed2022/11
Open114W    86_2Closed2022/11
Closed114W    90_2Closed2022/11
Closed115A 82017_2Closed2022/10
Closed115G     8_2Closed2022/10
Closed115W    28_2Closed2022/10
Closed116A 84000_2Closed2022/10

 

 Just to repeat the data is summarised to a table looking like this: 

 

Metric2022/092022/102022/11
Open015
Closed544
Outstanding143

 

To calculate outstanding for 2022/11 I just count keys where Status is Open.

To calculate outstanding for 2022/10 I need to do this calculation: Outstanding 2022/11 + Open 2022/11 - Closed 2022/11

To calculate outstanding for 2022/09 I need to calculate: Outstanding 2022/10 + Open 2022/10 - Closed 2022/10

and so on. Hope this helps

Hi,

How does one determine the o/s of 2022/11.  Is that a hard coded figure of 3?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

 I can see now that the table didn't paste correctly:

 

Metric2022/092022/102022/11
Open015
Closed544
Outstanding698

 

outstanding for 2022/11 I just count keys where Status is Open which is 8

For 2022/11, the number of rows where status is Open is only 2.  How did you get 8????


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

No, it's 8, as I said, for current month I only count rows with status open, regardless of date. Then for previous months outstanding calculation I do the calculations I already mentioned in my previous replies.

the date in the dataset is only used for calculating open and closed.

Data SetKeyStatusDate
Open110B  2523_2Closed2022/10
Closed110D 80082_2Open2022/09
Closed110G  2671_2Open2022/09
Closed110G  4440_2Open2022/09
Closed112C   103_2Open2022/09
Closed112W   954_2Open2022/09
Closed112W  1149_2Open2022/11
Closed113J     2_2Open2022/11
Closed113W   221_2Open2022/11
Open114A 82006_2Closed2022/11
Open114A 82010_2Closed2022/11
Open114W    59_2Closed2022/11
Open114W    82_2Closed2022/11
Open114W    86_2Closed2022/11
Closed114W    90_2Closed2022/11
Closed115A 82017_2Closed2022/10
Closed115G     8_2Closed2022/10
Closed115W    28_2Closed2022/10
Closed116A 84000_2Closed2022/10

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

To calculate outstanding for 2022/11 I just count keys where Status is Open.

why the outstanding for 2022/11 is 3 ? how can we get that result?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@username2 

could you pls provide the sample data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors