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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Show distribution of Dates in one Column based on another Date Column

Hello,

 

I have two tables:

- Milestones table, with two columns: Planned_Date and Actual_Date 

I have another Calendar Table, with two inactive relations: (One for actual and other for planned)

Wasv_0-1699788513380.png

 

I need to show the distribution of dates by month, but based on the two columns.

Let me explain: 

If I filter the month "May" in Calendar (with Active Planned_Date), I need to see in which months the Actual Dates (that were planned in May) have their Actual Date.

For example:

Actual_DatePlanned_Date
01/04/202201/05/2022
01/05/202201/05/2022
01/07/202201/05/2022

In this case: With Planned date in May (05) I have one Actual Date in April, One in May and another in July.

 

Normally, this is very easy to do, as in a Column Chart I only would need to put in X-Axis the Planned_Date.Month and in the Y-Axis, Count(Actual_Date), but has I have a Calendar table, this calculation has becoming in something specially complicated.

 

I found a solution creating a calculation column and using the column instead, getting the month:

CALCULATE(
    SELECTEDVALUE('Calendar'[Month_Name]),
    CALCULATETABLE(
        Milestones,
        USERELATIONSHIP('Calendar'[Date], Milestones[Planned_Date]),
        REMOVEFILTERS('Calendar')
    )
)

 

But then I have problems with the Sort...

I think that there must exist a solution using only a single measure without complicating this so much.

 

Example of desire result:

Wasv_1-1699789017237.png

 

Thank you!

3 REPLIES 3
ERD
Community Champion
Community Champion

Hi @Anonymous , you can try this measure:

countDt = 
CALCULATE( COUNT( 'Table'[Planned_Date]), USERELATIONSHIP('Date'[Date], 'Table'[Actual_Date]))

For the chart I used column from Date table, for the filter - 'Table'[Planned_Date]

ERD_0-1699792254706.png

 

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Anonymous
Not applicable

Hi @ERD 
In your case you are filtering directly from Planned Date, I need to filter from Calendar Table, for get the time intelligence columns (.Date / .Month / .Year ...)
That's the problem, that from Milestones Table I don't have access to these Time columns.
Regards.

ERD
Community Champion
Community Champion

Ok, one of the ways is to create a second Date table for the slicer, not connected to anything.

The measure: 

countDt = 
CALCULATE( COUNT('Table'[Actual_Date]), 'Table'[Planned_Date] in VALUES('Date_2'[Date]), USERELATIONSHIP('Date'[Date], 'Table'[Actual_Date]))

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

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors