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
RichOB
Post Partisan
Post Partisan

Calculating %'s from previous months data

Hi, using the data below, I need to show:

 

-  Each Issue % change from the previous month. For example

   Aggression: from Jan to Feb =  100%. Feb to March = 75%
   Missing People: from Jan to Feb = 300%. Feb to March = -75%

- Each location's total issue increase/decrease % per month. For example

   Bristol: Jan to Feb = -75%. Feb to March = 600%

 

LocationIssueDate
BristolAggression01/01/2025
BristolDrug01/01/2025
BristolDrug01/01/2025
BristolDrug01/01/2025
Manchester Aggression01/01/2025
Manchester Missing Person01/01/2025
BristolDrug01/02/2025
Manchester Aggression01/02/2025
Manchester Aggression01/02/2025
Manchester Aggression01/02/2025
Manchester Aggression01/02/2025
Manchester Missing Person01/02/2025
Manchester Missing Person01/02/2025
Manchester Missing Person01/02/2025
Manchester Missing Person01/02/2025
BristolAggression01/03/2025
BristolAggression01/03/2025
BristolAggression01/03/2025
BristolAggression01/03/2025
BristolAggression01/03/2025
BristolDrug01/03/2025
BristolDrug01/03/2025
Manchester Aggression01/03/2025
Manchester Aggression01/03/2025
Manchester Missing Person01/03/2025
1 ACCEPTED SOLUTION

Hi @RichOB,

 

When we want to calculate the number of incidents for a particular Issue and Date combination, we do not need to sum any field. Instead, we should count the number of records (rows) that meet the relevant conditions.

In the original DAX formula provided, where SUM('Table'[Value]) was used, it should be replaced with COUNTROWS('Table'). This function will correctly count the number of rows (incidents) for each Issue and Date, allowing you to then calculate the percentage change over time.

 

I hope this helped! Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.

 

Thank you.

View solution in original post

6 REPLIES 6
bhanu_gautam
Super User
Super User

@RichOB , Create a measure using

DAX
% Change =
VAR CurrentIssue = SELECTEDVALUE('Table'[Issue])
VAR CurrentDate = SELECTEDVALUE('Table'[Date])
VAR PreviousDate = CALCULATE(MAX('Table'[Date]), 'Table'[Date] < CurrentDate)
VAR PreviousValue = CALCULATE(SUM('Table'[Value]), 'Table'[Issue] = CurrentIssue, 'Table'[Date] = PreviousDate)
VAR CurrentValue = CALCULATE(SUM('Table'[Value]), 'Table'[Issue] = CurrentIssue, 'Table'[Date] = CurrentDate)
RETURN
IF(ISBLANK(PreviousValue), BLANK(), (CurrentValue - PreviousValue) / PreviousValue)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi @bhanu_gautam 

Thanks for your help. What would the SUM('Table'[Value] refer to?


sc.png

Hi @RichOB,

 

When we want to calculate the number of incidents for a particular Issue and Date combination, we do not need to sum any field. Instead, we should count the number of records (rows) that meet the relevant conditions.

In the original DAX formula provided, where SUM('Table'[Value]) was used, it should be replaced with COUNTROWS('Table'). This function will correctly count the number of rows (incidents) for each Issue and Date, allowing you to then calculate the percentage change over time.

 

I hope this helped! Feel free to ask any further questions. If this resolved your issue, please mark it as "Accept as Solution" and give us Kudos to assist others.

 

Thank you.

Hi @RichOB,

 

We haven’t heard from you on the last response and was just checking back to see if your query was answered.
Otherwise, will respond back with the more details and we will try to help .

If our response has addressed your query, please accept it as a solution and give a ‘Kudos’ so other members can easily find it. Please let us know if there’s anything else we can do to help.

 

Thank you.

Hi @RichOB,

 

I wanted to follow up on our previous suggestions regarding the issue. We would love to hear back from you to ensure we can assist you further.

If our response has addressed your query, please accept it as a solution and give a ‘Kudos’ so other members can easily find it. Please let us know if there’s anything else we can do to help.

 

Thank you.

Hi  @RichOB 

 

We wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.

If my answer resolved your query, please mark it as "Accept Answer" and give Kudos if it was helpful.

If you need any further assistance, feel free to reach out.

Thank you for being a valued member of the Microsoft Fabric Community Forum!

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
Top Kudoed Authors