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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

In a Bar graph I want to show only present week and previous week.

Hi Team I want to show only present week and previous week sales data.i mean only current week and previous week. I have week data available,

could you please help us with the DAX formula to get only present week of data and only previous week of data and how can I compare this on bar chart.

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You may put geography wise onto Rows box, put column Week Number onto Columns box, put measures Present week sales and Previous week sales onto Values box.

 

Best Regards,

Amy

 

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

5 REPLIES 5
v-xicai
Community Support
Community Support

 Hi @Anonymous ,

 

You can try to create week column first, then create measures like DAX below.

 

Column: Week Number= WEEKNUM(Table1[Date])
 
Measure: Present week sales= CALCULATE(SUM(Table1[sales]),FILTER(ALLSELECTED(Table1),Table1[Week Number] =MAX(Table1[Week Number])))
 
Measure: Previous week sales= CALCULATE(SUM(Table1[sales]),FILTER(ALLSELECTED(Table1),Table1[Week Number] =MAX(Table1[Week Number])-1))

Then choose Clustered bar chart visual to display the result, put column Week Number onto Axis box,   put the other measures onto Value box.

 

Best Regards,

Amy

 

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

 

Anonymous
Not applicable

This really helps..if I want to show the current weeks sales and previous week sales in geography wise?

Please help if I want to show current week sales and previous week sales geography wise 

 

Thank you.

Hi @Anonymous ,

 

>>Please help if I want to show current week sales and previous week sales geography wise 

 

From your words, could you please clarify what the "geography wise" is referred to ? 

 

Best Regards,

Amy

Anonymous
Not applicable

For Eg: 

 

Country wise , area wise , region wise...

 

United sates   current week sales  ,,,   previous week sales.

 

canada            Current week sales (value)      previous week sales(value)

 

I want this in the the matrix chart.

Hi @Anonymous ,

 

You may put geography wise onto Rows box, put column Week Number onto Columns box, put measures Present week sales and Previous week sales onto Values box.

 

Best Regards,

Amy

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (5,022)