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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Variable date for datediff

Hi good morning, I'm trying to make a column where using a date selected from another table from the Report view pane.

Right now I have this:

IF(
'Total Tickets'[Request Status] IN {"Open", "Ongoing", "On hold", "Standby Provider", "On Standby User", "Postponed", "Resolved"},
IF(
'Total Tickets'[End Date] IN {BLANK()},
DATEDIFF(
'Total Tickets'[Date created],
-------------
HOUR
),
BLANK()
)
)


Where I have the dashes in the datediff is where I need to put the variable date that I can select from the report view.

If I need any more information to be able to help, I can provide it.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Total tickets

vheqmsft_0-1714961711988.png
Time

vheqmsft_1-1714961741367.png

Create measure

Datediff = 
IF(
    SELECTEDVALUE('Total Tickets'[Request Status]) IN {"Open", "Ongoing", "On hold", "Standby Provider", "On Standby User", "Postponed", "Resolved"},
    IF(
        SELECTEDVALUE('Total Tickets'[End Date]) IN {BLANK()},
        DATEDIFF(
        SELECTEDVALUE('Total Tickets'[Date created]),
        SELECTEDVALUE('Time'[Another date]),
        HOUR
    ),
    BLANK()
    )
)

Final output

vheqmsft_2-1714961793193.png

 

Best regards,

Albert He

 

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
Syndicate_Admin
Administrator
Administrator

Hi @Syndicate_Admin I try it and let you know if it has worked for me


Thank you!

Anonymous
Not applicable

Hi @Syndicate_Admin ,
Here some steps that I want to share, you can check them if they suitable for your requirement.
Here is my test data:
Total tickets

vheqmsft_0-1714961711988.png
Time

vheqmsft_1-1714961741367.png

Create measure

Datediff = 
IF(
    SELECTEDVALUE('Total Tickets'[Request Status]) IN {"Open", "Ongoing", "On hold", "Standby Provider", "On Standby User", "Postponed", "Resolved"},
    IF(
        SELECTEDVALUE('Total Tickets'[End Date]) IN {BLANK()},
        DATEDIFF(
        SELECTEDVALUE('Total Tickets'[Date created]),
        SELECTEDVALUE('Time'[Another date]),
        HOUR
    ),
    BLANK()
    )
)

Final output

vheqmsft_2-1714961793193.png

 

Best regards,

Albert He

 

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

 

Perfect, works properly, thank you!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.