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
Anonymous
Not applicable

How can I compare last 24 weeks, last 12 weeks and last 4 weeks on same bar chart?

I have 2 calculated measured for the values, and I want 2 bars for each of these date ranges. I'm not sure of an easy way to accomplish this on the same chart though. Is there an easy easy way for me to compare these values for each date range on the same bar chart?

 

Also, my values are concatenating on the x axis even though I have concatenate off, and it only doesn't concatenate when I sort by the x axis text values ( i would like to sort by size of $).

 

Thanks so much!

13 REPLIES 13
Icey
Community Support
Community Support

Hi @Anonymous ,

 

Could you share us some sample data, not real data, and your expected result for test? It is suggested to upload your file to OneDrive for Business and then paste the link here.

 

 

Best regards

Icey

Anonymous
Not applicable

Sure, I appreciate the help! This has been frustrating me for 2 weeks now. I have uploaded to share point with my desired visuals, the hierarchy I wish to drill down, the table headers and actual table from BI (with random numbers). 

 

 

 

I appreciate any/all help as I try to get better with DAX and BI. Thanks so much! 

 

Link Updated

 

https://1drv.ms/x/s!Aouvm3o2ZFPjgx4PV6mYxiv90RTt?e=KZrZYP

Icey
Community Support
Community Support

Hi @Anonymous ,

 

I can't open your file. It exceeds the 25 MB file size limit. Please simplify your data and just leave the necessary part.

 

couldn't open the workbook.JPG

 

 

Best Regards,

Icey

Anonymous
Not applicable

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Please check the attached .pbix file.

legend.gif

 

 

Best Regards,

Icey

 

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

Anonymous
Not applicable

I appreciate the hard work Icey! It looks great, the only thing for Last 4, Last 12, Last 24, I would need the sum of those weeks. For example...total of POS GSV for the latest 4 weeks , Total POS Gsv for latest 12 weeks.

 

Sorry maybe I am looking at it incorrectly. 

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try to replace "=" with "<=" like below:

measure.JPG

 

 

Best Regards,

Icey

 

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

Anonymous
Not applicable

I tried changing those in each measure ("Sum of L4" etc), but it didn't make any changes. I apologize for the trouble! Would you have any other ideas? Again I really appreciate the help on this becuase my work around is a very manual process! Thanks so much

Icey
Community Support
Community Support

Hi @Anonymous ,

 

It works on my side. Any difference?

legend-sum.gif

 

In addition, if you don't need the Matrix visual above, the three separate measures are not needed. They are just for test. 

 

 

Best Regards,

Icey

 

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

Anonymous
Not applicable

Hi Icey,

 

I appreciate the help! Is there any way you can respond to my last post about the numbers not matching my data set? Was hoping to see if you had a solution to finally solve my problem. Just want to get this accepted!

 

Thanks,

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Sorry to reply late. 

I have changed the fact table from "Main BI Data Table" to "Original Excel Data Source" and modified the measures. Please check the attached .pbix file.

 

new measures.JPG

 

 

Best Regards,

Icey

 

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

Anonymous
Not applicable

Hi Icey, I appreciate your continued help on this and it looks like we are very close! I filtered to L4, Category 1, UDP_4 brand 1, and Account 1, for the POS GSV source. 

 

tjco225_0-1615224145632.png

 

This number is close, but doesn't match the totals from the data set below. Can you show what dates that this would be showing data for from the excel data set? i Would like to be able to just filter out dates that haven't happened yet and the data would show the latest 4 weeks of values. 

 

I've tried summing the below data in different ways and I can't get to the 31969 for latest 4. 

 

tjco225_1-1615224298546.png

 

 

amitchandak
Super User
Super User

@Anonymous , These three will have a lot of dates that are not common. The only way to compare is to not to have a date on x-axis. No Axis or x-axis should not have date or date related column.

 

rolling you can get like

Rolling 12 week= CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-12*7,Day))

 

 

You can also refer to my WOW blog

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

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.