cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
oscarmqz Frequent Visitor
Frequent Visitor

Flag first run time by report, day and time

Hi, I'm trying to add a column to flag the first time a report ran by day to get something like this

 

REPORT_NMSTART_TS1st Time run
AMS_PPS_TRADE_BCKLOG_DTL12/1/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/1/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/4/2017 15:00 1
AMS_PPS_TRADE_BCKLOG_DTL12/5/2017 8:00 1
AMS_PPS_TRADE_BCKLOG_DTL12/6/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/6/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/6/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/7/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/7/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/8/2017 8:001
AMS_PPS_TRADE_BCKLOG_DTL12/8/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/8/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/9/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/9/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/9/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/10/2017 8:001
AMS_PPS_TRADE_BCKLOG_DTL12/10/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/10/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/11/2017 9:251
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/13/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/13/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/13/2017 15:00 
PREV_DAYS_ORDERS12/1/2017 2:001
PREV_DAYS_ORDERS12/2/2017 2:001
PREV_DAYS_ORDERS12/5/2017 2:001
PREV_DAYS_ORDERS12/7/2017 2:001
PREV_DAYS_ORDERS12/8/2017 2:001
PREV_DAYS_ORDERS12/8/2017 21:56 
PREV_DAYS_ORDERS12/9/2017 2:001
PREV_DAYS_ORDERS12/10/2017 2:001
PREV_DAYS_ORDERS12/11/2017 2:001
PREV_DAYS_ORDERS12/12/2017 2:001
PREV_DAYS_ORDERS12/13/2017 2:001

 

Thanks in advance for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flag first run time by report, day and time

Hi @oscarmqz,


You can try to use below formula to create a calculate column to tag first date.

First Time Flag =
VAR first_time =
    CALCULATE (
        MINX ( VALUES ( Table1[START_TS] ), [START_TS] ),
        Table1[REPORT_NM] = EARLIER ( [REPORT_NM] ),
        DATEVALUE ( Table1[START_TS] ) = DATEVALUE ( EARLIER ( Table1[START_TS] ) )
    )
RETURN
    IF ( [START_TS] = first_time, 1 )

1.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

2 REPLIES 2
oscarmqz Frequent Visitor
Frequent Visitor

Flag first ocurrence by day and time

Hi, I'm trying to flag the first time a report runs every single day. I'm pretty new to DAX so I'm having a hard time. I've tried using earlier and rankx.

 

Example

 

REPORT_NMSTART_TS1st Time run
AMS_PPS_TRADE_BCKLOG_DTL12/1/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/1/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/4/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/5/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/6/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/6/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/6/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/7/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/7/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/8/2017 8:001
AMS_PPS_TRADE_BCKLOG_DTL12/8/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/8/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/9/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/9/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/9/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/10/2017 8:001
AMS_PPS_TRADE_BCKLOG_DTL12/10/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/10/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/11/2017 9:251
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 8:00 
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/12/2017 15:00 
AMS_PPS_TRADE_BCKLOG_DTL12/13/2017 3:001
AMS_PPS_TRADE_BCKLOG_DTL12/13/2017 13:00 
AMS_PPS_TRADE_BCKLOG_DTL12/13/2017 15:00 
PREV_DAYS_ORDERS12/1/2017 2:001
PREV_DAYS_ORDERS12/2/2017 2:001
PREV_DAYS_ORDERS12/5/2017 2:001
PREV_DAYS_ORDERS12/7/2017 2:001
PREV_DAYS_ORDERS12/8/2017 2:001
PREV_DAYS_ORDERS12/8/2017 21:56 
PREV_DAYS_ORDERS12/9/2017 2:001
PREV_DAYS_ORDERS12/10/2017 2:001
PREV_DAYS_ORDERS12/11/2017 2:001
PREV_DAYS_ORDERS12/12/2017 2:001
PREV_DAYS_ORDERS12/13/2017 2:001
Community Support Team
Community Support Team

Re: Flag first run time by report, day and time

Hi @oscarmqz,


You can try to use below formula to create a calculate column to tag first date.

First Time Flag =
VAR first_time =
    CALCULATE (
        MINX ( VALUES ( Table1[START_TS] ), [START_TS] ),
        Table1[REPORT_NM] = EARLIER ( [REPORT_NM] ),
        DATEVALUE ( Table1[START_TS] ) = DATEVALUE ( EARLIER ( Table1[START_TS] ) )
    )
RETURN
    IF ( [START_TS] = first_time, 1 )

1.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 2 members 227 guests
Recent signins:
Please welcome our newest community members: