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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bmpi
Frequent Visitor

Deconnect relationship?

I am trying to calculate the count of active tasks in selected period, but I don't know how I should treat the relationships between the tables.

 

The table 'Task' is connected to 'DimDate' by start date, and when I count the active tasks this realtionships seems to mess it up since I only get the task with startdate = MIN(DimDate) selected.

 

Measure looks like this:

# Tasks =
    VAR mxdt = MAX(dimDate[Date])
    VAR mndt = MIN(dimDate[Date])
    VAR  CALC = CALCULATE(
                    DISTINCTCOUNT(Task[Task ID])
                        , FILTER(ALL(Task[End Date],Task[Start Date])
                        , (Task[End Date] <= mxdt && Task[End Date] >= mndt)
                    || (Task[Start Date] >= mndt && Task[Start Date] <= mxdt && Task[End Date] >= mxdt)
                    || (Task[Start Date] <= mndt && Task[End Date] >= mxdt)
                                )
                        )
    RETURN
    CALC
 
I want to count all ongoing tasks, so if I select one day (eg 05.10.2022) I will list all ongoing tasks, not only the one starting on 05.10.2022
 
 

bmpi_0-1665400478623.png

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@bmpi , refer to the attached file after signature 

 

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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@bmpi , refer to the attached file after signature 

 

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.