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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
ChrisB1977
Frequent Visitor

Issues with one to many date relationship

Hi,

 

I'm trying to build some bar charts displaying data by month. I have a date table set-up in Power BI (this is marked as a date table), and have formed a relationship between this and the date column in the table containing all of the metrics I need. I've had to set this the relationship as one to many (date table to metrics table) as the metrics table can have more than on entry for the same date.

 

When I display the visual, which is meant to show monthly totals over a 6 month period, I get individual bars for each date entry from the metrics table (i.e. lots of individual Julys, Mays etc), rather than consolidating them into a single month total - is there a way that this can be avoided so that I just have one bar on my bar graph for each month?

 

Many thanks in advance

 

Chris

1 ACCEPTED SOLUTION

Based on what I see I wonder if you have turned on, updated Power BI to have Date Hierarchiesdateh.PNG

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

Seems like you are using the raw [Date] in your axis instead of the built-in date hierarchy? You really should be using the date dimension date as your axis in all likelihood. You can always create a "month" column in your date dimension if you do not want to use the built-in hiearchy, something like FORMAT([Date],"mmmm")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you for the quick response @Greg_Deckler, makes sense. I'd ideally like to use the PowerBI date hierachy. but this this doesn't seem to work with my date table - is there a way I can restore this? As I mentioned in my earlier post. it is currently marked as a date table.

 

Many thanks

 

Chris

Hmm, are you certain that the column is set to a type of Date or Date/Time and not Text?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

I think so, but not 100% Please see the screengrab below:

 

 Capture.PNG

Based on what I see I wonder if you have turned on, updated Power BI to have Date Hierarchiesdateh.PNG

That was it, thank you!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.