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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
zhona9
Resolver I
Resolver I

Column chart with two different date for the same month

I would like to make a stacked column chart that reports the number of incidents closed in a month, basis the incident sign-off date and the number of incidents reported in a month, basis the incident reported date. The Y-axis will the be number of incidents and the X-axis is the month-year of the past 12 months.

 

The tables are imported using Direct Query as the dataset is large. Hence I am unable to do any calculated columns, only DAX measures.

 

Is this possible?

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create 2 relationships from your date table to your fact table, one based on the sign off date and one based on the reported date. You can then activate the correct relationship in the measures like

Num reported =
CALCULATE (
    COUNTROWS ( 'Table' ),
    USERELATIONSHIP ( 'Date'[Date], 'Table'[Reported date] )
)

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

Create 2 relationships from your date table to your fact table, one based on the sign off date and one based on the reported date. You can then activate the correct relationship in the measures like

Num reported =
CALCULATE (
    COUNTROWS ( 'Table' ),
    USERELATIONSHIP ( 'Date'[Date], 'Table'[Reported date] )
)

Do you have a link to how to create a date table? 

 

I found this code, but not sure if it is correct.

 

Dates = CALENDAR(MIN('g360_Incidents'[reported_date]),MAX('g360_Incidents'[risk_lead_sign_off_date]))

 

I get an error:

zhona9_0-1683531734151.png

 

https://bravo.bi/ can create date tables for you. The syntax you used is correct, not sure why you're getting an error. Maybe some of the dates in the columns you referenced are blank.

In the end I used the reported date for min and max in the date table and it was ok. You are right, the sign off date will be blank at times and that caused the error.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.