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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sean2
Helper I
Helper I

Combine two clustered charts

Not having any luck finding help on this one but I can't be the first to ask. I have two visuals that I'd like to have in one. I have a Date Table, and I have another CSV data source with labor hours by day.

I've got it looking mostly how I'd like but it would be nice to have them to together. I have little to no experince with DAX.

Thanks!

 

Sean2_0-1642615776440.png

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @Sean2 ,

 

1.Did you apply some filters like Year=2020/ Year=2021 to get such output ?

Eyelyn9_1-1643073974087.png

2. If your data from CSV file has Date column,  and you have used it for X-axis, could you please drag Date.Year to Legend field to get values by different years? 

 

3. And what is the Date table used for?  Is there ny relationship between these two tables?

 

4. Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
v-eqin-msft
Community Support
Community Support

Hi @Sean2 ,

 

As I mentioned before :drag Date.Year to Legend field to get values by different years

 

1. Apply filter—— Year=2020 or 2021:

Eyelyn9_1-1643160295884.png

 

2. Add a slicer:

Eyelyn9_2-1643160333040.png

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Evelyn. This is the piece I was missing. Using that legend trick will be very helpful going forward!

v-eqin-msft
Community Support
Community Support

Hi @Sean2 ,

 

1.Did you apply some filters like Year=2020/ Year=2021 to get such output ?

Eyelyn9_1-1643073974087.png

2. If your data from CSV file has Date column,  and you have used it for X-axis, could you please drag Date.Year to Legend field to get values by different years? 

 

3. And what is the Date table used for?  Is there ny relationship between these two tables?

 

4. Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-eqin-msft , thanks for taking the time to look. 

Yes I just applied a filter to each of those visuals. The Date table is related.

I have posedt a PBIX file with other stuff removed. If you could take a look I'd really appreciate it.

 

https://drive.google.com/drive/folders/1nByRHwkPuWEOtKXzV84tpOHAin5idOHQ?usp=sharing

 

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for showing me the "same period last year" that could be helpful too.

Ashish_Mathur
Super User
Super User

Hi,

Ensure there is a relationship from the Date column of your Data table to the Date column of the Date Table.  In the Date Table, write calculated column formulas to extract Year, Month Name and Month Number.  Sort the Month Name by the Month number.  To your visual, drag Year and Month Name from the Date Table.  Write this measure

Total hours = sum(Data[hours])

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks @Ashish_Mathur 

How would I create the custom columns for 2020 and 2021? Can't figure out how to write that.

 

Sean2_0-1642945797363.png

 

Hi,

If you want to create a Calendar Table for 2020 and 2021, then simply write this Table formula

Calendar = calendar(date(2020,1,1),date(2021,12,31))

Now add as many calculated columns as you want to this Calendar Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Sean2 , Create measure for this year and last year and use in same visual

 

create a date table join on date, have year and month in date table

Option one Year as legend , Month on axis and measure on values 

 

 

In case you need measure , then for last year use measure like

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks @amitchandak. Thanks helps some, but I'm wanting a measure for specific years. Not relative to current year.

Is there a way to make that kind of measuer for 2019, 2020, 2021, ect?  

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.