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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Coffee2023
Frequent Visitor

Find value from the last 8 days, based on measure and date difference calculations

Hi, I need to find the Events Delta (Delta Column in picture below) from the last 8 days, based on my measure calculation created for # of Events and Create Date Difference expression, which calculates the difference in days between my create date and today.

 

Example of wanted outcome: 

Coffee2023_3-1721769470050.png

# of Events = COUNTROWS(FILTER(vw_table,vw_table[COTypeName] = "Event"))
 
Create Date Difference = DATEDIFF('vw_table'[CreateCODate], TODAY(), DAY)
Coffee2023_1-1721768896946.png

 

Current Errored Delta Forumla: 

Delta = CALCULATE(SUMX('vw_table, 'vw_table[# of Events]FILTER('vw_table,'vw_table[Create Date Difference] < 8)))
 

Thank you in advance for your help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Coffee2023 ,

 

Thanks for the reply from @AmiraBedh , please allow me to provide another insight: 

 

According to your description, I added a few rows of data.

vkaiyuemsft_0-1721981134036.png

 

You can create calculated columns.

 

Column = 
CALCULATE (
    COUNT ( 'Table'[Site Name] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Outreach TypeName] = "Event"
            && 'Table'[Site Name] = EARLIER ( 'Table'[Site Name] )
            && 'Table'[Outreach Create Date].[Date]
                <= EARLIER ( 'Table'[Outreach Create Date].[Date] )
            && 'Table'[Outreach Create Date].[Date]
                > EARLIER ( 'Table'[Outreach Create Date].[Date] ) - 8
    )
)

 

vkaiyuemsft_1-1721981172848.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

5 REPLIES 5
Anonymous
Not applicable

Hi @Coffee2023 ,

 

Thanks for the reply from @AmiraBedh , please allow me to provide another insight: 

 

According to your description, I added a few rows of data.

vkaiyuemsft_0-1721981134036.png

 

You can create calculated columns.

 

Column = 
CALCULATE (
    COUNT ( 'Table'[Site Name] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Outreach TypeName] = "Event"
            && 'Table'[Site Name] = EARLIER ( 'Table'[Site Name] )
            && 'Table'[Outreach Create Date].[Date]
                <= EARLIER ( 'Table'[Outreach Create Date].[Date] )
            && 'Table'[Outreach Create Date].[Date]
                > EARLIER ( 'Table'[Outreach Create Date].[Date] ) - 8
    )
)

 

vkaiyuemsft_1-1721981172848.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

 

AmiraBedh
Super User
Super User

Can you share yopur initial data ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Coffee2023_0-1721924639677.pngCoffee2023_1-1721924677512.png

Here are some examples

Can you formulate an understable dataset in text and not image ? help us to help you ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Site NamePIOutreach TypeNameOutreach Create Date
IACT HealthPaullEvent7/10/2019 11:43
Center of Reproductive MedicineSchnellEvent7/9/2019 23:50
Center for Cognitive HealthMegaEvent7/9/2019 15:42
Center for Cognitive HealthMegaEvent7/9/2019 15:34
Baumann Cosmetic & Research InstituteBaumannEvent7/7/2019 21:37
Baumann Cosmetic & Research InstituteBaumannEvent7/7/2019 21:35
Baumann Cosmetic & Research InstituteBaumannEvent7/7/2019 21:33
Baumann Cosmetic & Research InstituteBaumannEvent7/7/2019 21:13
Baumann Cosmetic & Research InstituteBaumannEvent7/7/2019 21:07
Center of Reproductive MedicineSchnellEvent7/5/2019 23:54
Center for Cognitive HealthMegaEvent7/5/2019 12:18
Meridien Research - St. PetersburgLefebvreEvent7/3/2019 13:30
Meridien Research - St. PetersburgLefebvreEvent7/3/2019 13:26
Baumann Cosmetic & Research InstituteBaumannEvent7/1/2019 22:52
Baumann Cosmetic & Research InstituteBaumannEvent7/1/2019 22:51

 

Let me know if this is helpful. Thank you!

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.