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
prashantg364
Helper II
Helper II

DAM measure

Hi All,

i wan to calculate the number of days spent against each workflow.

There will be multiple rows of same Workflow in the data set based on number of time woid has been executed. Woid column is unique values.

for each workflow I need to calculate the end date-start date

 

for eg:

 

workflow name: 

 Performance Analysis Multi

 

min of start date is 18-05-23

max of end date is 07-06-23

total spent days =  07-06-23 - 18-05-23 = 20 days

 

woidWO_NetworkElementName/IDworkflownameStart DateEnd Date
218354299M0096 Pre Swap KPI Preparation Multi15-05-202315-05-2023
218354301M0096 Pre Swap KPI Preparation Multi16-05-202316-05-2023
218495911M0096 AUDIT17-05-202317-05-2023
218471333M0096 Full Health Check Multi16-05-202316-05-2023
218514715M0096 hourly KPI report preparation Multi18-05-202318-05-2023
218495923M0096 hourly KPI report preparation Multi17-05-202317-05-2023
218471356M0096 hourly KPI report preparation Multi16-05-202316-05-2023
218621069M0096 Performance Analysis Multi24-05-202324-05-2023
218796428M0096 Performance Analysis Multi03-06-202303-06-2023
218514691M0096 Performance Analysis Multi18-05-202318-05-2023
218776601M0096 Performance Analysis Multi02-06-202302-06-2023
218867723M0096 Performance Analysis Multi07-06-202307-06-2023
218580207M0096 Final Acceptance Report U BOT Multi22-05-202322-05-2023
218810065M0096 Final Acceptance Report U BOT Multi05-06-202305-06-2023
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @prashantg364 

You can refer to the following measure

 

DAM =
VAR a =
    FILTER (
        ALLSELECTED ( 'Table' ),
        [workflowname] IN VALUES ( 'Table'[workflowname] )
    )
VAR b_mindate =
    MINX ( a, [Start Date] )
VAR b_maxdate =
    MAXX ( a, [End Date] )
RETURN
    DATEDIFF ( b_mindate, b_maxdate, DAY )

 

Output

vxinruzhumsft_0-1689920365636.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @prashantg364 

You can refer to the following measure

 

DAM =
VAR a =
    FILTER (
        ALLSELECTED ( 'Table' ),
        [workflowname] IN VALUES ( 'Table'[workflowname] )
    )
VAR b_mindate =
    MINX ( a, [Start Date] )
VAR b_maxdate =
    MAXX ( a, [End Date] )
RETURN
    DATEDIFF ( b_mindate, b_maxdate, DAY )

 

Output

vxinruzhumsft_0-1689920365636.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

it's helps. Thanks for the suggestion.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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