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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Coffee2023
Frequent Visitor

Finding row values for last 8 days based on measure & expression calculating the difference in days

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_0-1721923970747.png

 

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

 

Current Errored Delta Forumla: 

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

 

 

Thank you in advance for your help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Coffee2023 ,

Unable to see the details of your error .

vzhouwenmsft_0-1721959409245.png

I assumed some data:

vzhouwenmsft_1-1721959471656.png

Use the following DAX expression to create a measure

Delta = 
VAR _result = COUNTROWS(FILTER('vw_table','vw_table'[COTypeName] = "Event" && 'vw_table'[Create Date Difference] < 8)) 
RETURN IF(ISBLANK(_result),0,_result)

Final output

vzhouwenmsft_2-1721959573467.png

 

Best Regards,
Wenbin Zhou

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Coffee2023 ,

Unable to see the details of your error .

vzhouwenmsft_0-1721959409245.png

I assumed some data:

vzhouwenmsft_1-1721959471656.png

Use the following DAX expression to create a measure

Delta = 
VAR _result = COUNTROWS(FILTER('vw_table','vw_table'[COTypeName] = "Event" && 'vw_table'[Create Date Difference] < 8)) 
RETURN IF(ISBLANK(_result),0,_result)

Final output

vzhouwenmsft_2-1721959573467.png

 

Best Regards,
Wenbin Zhou

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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