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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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