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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
IAM
Helper III
Helper III

Solution without extra columns?

Hi all,

 

Hope you can help me design something without adding extra columns.

 

I want to see the average days between 3 different statuses per employee.

Between date creation -> planned -> actual

 

On the X should be name of employee, no problem.

 

But the Y..

Date created is the basis, so always 0

 

The other two should be the difference between created and planned

And planned and finish.

 

What is the best way to do this? A way that I can still drill through. Do I need to make an extra column, or measure, or can I build this directly in a chart?

 

Thanks!

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

Hi @IAM ,

 

We assum data looks like this:

vchenwuzmsft_0-1652345373255.png

create a measure to calculate the average days.

Measure =
VAR _s1 = "creation"
VAR _s2 = "planned"
VAR _s3 = "actual"
VAR _s1_s2 =
    VALUE (
        CALCULATE (
            MAX ( 'Table'[start date] ),
            FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s2 )
        )
            - CALCULATE (
                MAX ( 'Table'[start date] ),
                FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s1 )
            )
    )
VAR _s2_s3 =
    VALUE (
        CALCULATE (
            MAX ( 'Table'[start date] ),
            FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s3 )
        )
            - CALCULATE (
                MAX ( 'Table'[start date] ),
                FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s2 )
            )
    )
RETURN
    DIVIDE ( _s1_s2 + _s2_s3, 2 )

 

Pbix file in the end and hope this  helpful.

 

Best Regards

Community Support Team _ chenwu 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

4 REPLIES 4
v-chenwuz-msft
Community Support
Community Support

Hi @IAM ,

 

We assum data looks like this:

vchenwuzmsft_0-1652345373255.png

create a measure to calculate the average days.

Measure =
VAR _s1 = "creation"
VAR _s2 = "planned"
VAR _s3 = "actual"
VAR _s1_s2 =
    VALUE (
        CALCULATE (
            MAX ( 'Table'[start date] ),
            FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s2 )
        )
            - CALCULATE (
                MAX ( 'Table'[start date] ),
                FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s1 )
            )
    )
VAR _s2_s3 =
    VALUE (
        CALCULATE (
            MAX ( 'Table'[start date] ),
            FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s3 )
        )
            - CALCULATE (
                MAX ( 'Table'[start date] ),
                FILTER ( ALLSELECTED ( 'Table'[status] ), [status] = _s2 )
            )
    )
RETURN
    DIVIDE ( _s1_s2 + _s2_s3, 2 )

 

Pbix file in the end and hope this  helpful.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

danextian
Super User
Super User

Hi @IAM ,

It is difficult to imagine what you're trying to achieve without a sample data.  Please also post your expected or if you were to do it in Excel, what would your formula be?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
IAM
Helper III
Helper III

Hi, thanks I know, the thing is I don't have anything yet, I'm just mapping out how I want to design something.

 

 

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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