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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
torbenani
Frequent Visitor

Comparing date isue

Hi 

hope you're able to help me with this issue.

In a table of service request, I want to list requsts, which has been closed (solutiondate) within a given date range.

the calendar table is link to the CreateDate of the request, so it won't work. 

I've this meassure. 

Closed in Selcted periond = if(SELECTEDVALUE(bi_Request[solutionDate]) < MAX('Calendar'[date]) && SELECTEDVALUE(bi_Request[solutionDate]) > CALCULATE(MIN('Calendar'[Date])) , "Yes", "No")

 

On every row the meassure is evaluated to "yes". What am I missing?

 

 

Capture3.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @torbenani 

From my test, you just need to build an unrelated Calendar Table, then your measure works well.

I build a easy sample.

1.png

Calendar Table:

Calendar = CALENDARAUTO()

You don't need to build a relationship between two tables.

I try your measure. 

Closed in Selcted periond = if(SELECTEDVALUE('Table'[Solution Date]) < MAX('Calendar'[date]) && SELECTEDVALUE('Table'[Solution Date]) > CALCULATE(MIN('Calendar'[Date])) , "Yes", "No")

Result:

2.png

Best Regards,

Rico Zhou

 

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
Anonymous
Not applicable

Hi @torbenani 

From my test, you just need to build an unrelated Calendar Table, then your measure works well.

I build a easy sample.

1.png

Calendar Table:

Calendar = CALENDARAUTO()

You don't need to build a relationship between two tables.

I try your measure. 

Closed in Selcted periond = if(SELECTEDVALUE('Table'[Solution Date]) < MAX('Calendar'[date]) && SELECTEDVALUE('Table'[Solution Date]) > CALCULATE(MIN('Calendar'[Date])) , "Yes", "No")

Result:

2.png

Best Regards,

Rico Zhou

 

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

 

MFelix
Super User
Super User

Hi @torbenani ,

 

For this you need to create an inactive relationship between the calendar table and the solutiondate column then you can make a simple measure using the USERELATIONSHIP formula, it should look something similar to this:

 

Closed number =
IF (
    CALCULATE (
        COUNT ( bi_request[ID] ),
        USERELATIONSHIP ( bi_request[solutiondate], Calendar[Date] )
    ) > 0,
    "Yes",
    "No"
)

Check result below and in attach file

 

MFelix_0-1625592792323.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





Thanks Miguel. This is great. You've tought med about userrelationship.
For others, who don't know about USERRELATIONSHIP - check aout this video.
https://www.youtube.com/watch?v=zZLH8Y1tO1g

 

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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