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
Chris2016
Resolver I
Resolver I

Calendar that links two date columns so that calculated measures can be displayed in a single visual

Hello, 

 

I need help with the following issue.

I have a table that contains two date columns - one for Task Assigned and one for Task Completed:

 

NameTaskActiveAssigned DateCompleted date_FYAssigned_FYCompletedCompletionPercentage

Ano1True11/09/202210/10/0202FY2023FY203100
Bno1True05/02/202206/10/2022FY2022FY2022100
Cno2True10/12/202110/01/2022FY2022FY2023100
Dno2True02/15/202204/10/2022FY2022FY2022100
Ano3False01/02/202002/04/2020FY2020FY2020100
Bno2True04/07/2022 FY2022FY54.32098765432
D True04/03/2022 FY2022FY92.307692307692
Fno1True05/10/2022 FY2022FY1.666666666666
Gno2True  Missing Assigned DateFY53.086419753086
Hno1True 10/05/2022Missing Assigned DateFY2023100
Ino4True  Missing Assigned DateFY 
Jno4True 11/05/2021Missing Assigned DateFY2022100
Kno3False  Missing Assigned DateFY 

 

Some measures and columns are calculated based on each of the date columns. Since I can only create a relationship with the Calendar table for one of the date columns ("Assigned date"), is there a way to create a calendar calculation that will allow me to display the calculated columns and measures for both Assigned and Completed in the same visual? I would need that calculation to use instead of the FY and FQ in the Calendar table, which now filters based on the relationship created with "Assigned date".

 

Chris2016_1-1668434988736.png

 

Power BI sample file here: https://www.transfernow.net/dl/20221114Jb5N9v4p

 

Thanks a lot for any help!

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

Hi @Chris2016 ,

 

Please follow these steps:

(1) Create a new relationship

vjialluomsft_0-1668501067486.png

 

 

(2) Create an index to prevent data aggregation

vjialluomsft_1-1668501067493.png

 

 

(3) Create measures

new complete date =
IF (
    ISINSCOPE ( 'Table'[Index] ),
    CALCULATE (
        MAX ( 'Table'[Completed date] ),
        USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )
    )
)


#newCompleteUsers =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Name] ),
    'Table'[Active] = TRUE (),
    USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )
)


#newCompleteTasks =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Task] ),
    'Table'[Active] = TRUE (),
    USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )
)

 

(4)Final output

vjialluomsft_2-1668501067501.png

 

 

Best Regards,

Gallen Luo

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

3 REPLIES 3
v-jialluo-msft
Community Support
Community Support

Hi @Chris2016 ,

 

Please follow these steps:

(1) Create a new relationship

vjialluomsft_0-1668501067486.png

 

 

(2) Create an index to prevent data aggregation

vjialluomsft_1-1668501067493.png

 

 

(3) Create measures

new complete date =
IF (
    ISINSCOPE ( 'Table'[Index] ),
    CALCULATE (
        MAX ( 'Table'[Completed date] ),
        USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )
    )
)


#newCompleteUsers =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Name] ),
    'Table'[Active] = TRUE (),
    USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )
)


#newCompleteTasks =
CALCULATE (
    DISTINCTCOUNT ( 'Table'[Task] ),
    'Table'[Active] = TRUE (),
    USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )
)

 

(4)Final output

vjialluomsft_2-1668501067501.png

 

 

Best Regards,

Gallen Luo

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

Hi, Gallen,

 

Thanks a lot, this helps. 
I used ISINSCOPE for the calendar FY in order to get rid of the index: 

#new complete date = 

IF (

    ISINSCOPE ( 'Calendar'[FY] ),

    CALCULATE (

        MAX ( 'Table'[Completed date] ),

        USERELATIONSHIP ( 'Calendar'[Date], 'Table'[Completed date] )

    )

)

And this gives me what I need:

 

Chris2016_0-1669220505901.png

 

Thanks again!

amitchandak
Super User
Super User

@Chris2016 , refer if this blog or attcahed file can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.