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
Ltbabyj
Frequent Visitor

Power Automate email with Power BI data - need today's date (instead of report filter)

Hi all - I am a newbie to Power BI and certainly to Power Automate.  I have followed a couple of great YouTube videos on creating scheduled emails linking my Power BI reports however, I believe (but tell me if I'm wrong) that the Dax Query that I copied includes the filtered date and appears to be the reason why the data set is not refreshing with the scheduled emaill.  The Power BI report is functioning correctly which is to only pull the most recent 24 hours of data.  See below the Dax query.  

 

// DAX Query

DEFINE

VAR __DS0FilterTable =

FILTER(

KEEPFILTERS(VALUES('DailyLogManpower'[created_at])),

AND(

'DailyLogManpower'[created_at] >= (DATE(2024, 2, 1) + TIME(18, 57, 26)),

'DailyLogManpower'[created_at] <= (DATE(2024, 2, 2) + TIME(18, 57, 26))

)

)

 

 

I created this scheduled email on Friday (2/2).  Is there any way to replace the date shown above with a Dax coding for today()?

Thank you!

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @Ltbabyj ,

Please try:

VAR __DS0FilterTable =
    FILTER(
        KEEPFILTERS(VALUES('DailyLogManpower'[created_at])),
		AND(
        'DailyLogManpower'[created_at] >= (UTCNOW() - 1)  , 'DailyLogManpower'[created_at] <= UTCNOW()
		)
    )

 You can decide which function to use based on the results returned by measure in the demo.

vcgaomsft_0-1707188085539.pngTODAY function (DAX) - DAX | Microsoft Learn
UTCNOW function (DAX) - DAX | Microsoft Learn
UTCTODAY function (DAX) - DAX | Microsoft Learn

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

2 REPLIES 2
Ltbabyj
Frequent Visitor

Thank you!

v-cgao-msft
Community Support
Community Support

Hi @Ltbabyj ,

Please try:

VAR __DS0FilterTable =
    FILTER(
        KEEPFILTERS(VALUES('DailyLogManpower'[created_at])),
		AND(
        'DailyLogManpower'[created_at] >= (UTCNOW() - 1)  , 'DailyLogManpower'[created_at] <= UTCNOW()
		)
    )

 You can decide which function to use based on the results returned by measure in the demo.

vcgaomsft_0-1707188085539.pngTODAY function (DAX) - DAX | Microsoft Learn
UTCNOW function (DAX) - DAX | Microsoft Learn
UTCTODAY function (DAX) - DAX | Microsoft Learn

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

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.

Top Solution Authors
Top Kudoed Authors