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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SebastianAE
Frequent Visitor

Get Data from last seven days

Hello I´m trying to get log count from the last 7 days by day. Like today -1, today - 2, today -3 ans so on up to 7 days.

 

I´m using this formula but I´m receiving the same results for each day

 

Current Day -7 = CALCULATE(DISTINCTCOUNT(AUDIT_LOG[SUCCEED_ROW_COUNT]),DATEADD(AUDIT_LOG[AUDIT_TS].[Date], -7,DAY))
 
SUCCEED_ROW_COUNT is my log count and my Date column is Audit_TS. 
 
Any advice on how to get the correct count is appreciated, thanks!
2 REPLIES 2
Daniel29195
Super User
Super User

Hello @SebastianAE 

 

 

create a dimdate table , 

link it to the table --> audit_log 

use in your visuals the date from the dimdate 

 

create the below measure : 

Current Day7 = 
CALCULATE(
DISTINCTCOUNT(AUDIT_LOG[SUCCEED_ROW_COUNT]),
DATEADD(dimdate[date], -7,DAY),
all(dimdate)
)

 

 

let me know if this helps ..

 

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

 

Hi Daniel, thank you for your help unfortunately this didn´t work.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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