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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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!:
The Definitive Guide to Power Query (M)

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!:
The Definitive Guide to Power Query (M)

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors