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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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