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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Coffee2023
Frequent Visitor

Find Delta for each row and outreach type over last 8 days

Hello community,

I am looking for help with this DAX equation to find the delta for each row (site/ PI), and for each type of outreach (event, location..ect.) Please see my current equations and screenshot below. It appears correct except it is dulicating everything several times.

 

Measure *Event = COUNTROWS(FILTER(vw_CommunityOutreachHistoric01,vw_CommunityOutreachHistoric01[COTypeName] = "Event"))
 
Measure Event delta = Var EV = CALCULATE([*Event],FILTER(vw_CommunityOutreachHistoric01, vw_CommunityOutreachHistoric01[CO Create Date Difference]< 8)) return "(+" & IF(ISBLANK(EV), "0)", EV)
 
Coffee2023_0-1721410470625.png

 Thank you for your help in advance! 

5 REPLIES 5
Greg_Deckler
Super User
Super User

@Coffee2023 See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395....
The basic pattern is:
Column = 
  VAR __Current = [Value]
  VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])

  VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
 ( __Current - __Previous ) * 1.

 

Hard to be more specific without sample data, expected output, etc. Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Hi thank you for your reply.

I am hoping to get the delta for each Outreach type: Event, Location and Referral Provider in the below table By Site Name. Each of the outreach types are calculated using a measure, for example: 

*Event= COUNTROWS(FILTER(vw_CommunityOutreachHistoric01,vw_CommunityOutreachHistoric01[COTypeName] = "Event"))
 
Now, I need to find the delta for the number of events over the last 8 days in a seperate column.

Coffee2023_0-1721412215865.png

Thank you! Let me know if I need to elaborate more.

@Coffee2023 Sample data as text. Expected output.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I am not sure what you are suggesting. Here is what I am looking for 

Coffee2023_0-1721413393616.png

 

 

@Coffee2023 Read this, it is quite clear: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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