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
chalam87
Frequent Visitor

Slicer month measures and last 12 months sales.

Hi,

 

I am new to Power BI, could you please suggest me how can we achieve the below requeriment.

 

I have month and year slicer like Dec 2017, Nov 2017,Oct 2017, Sep 2017........Jan 2017, when ever select any one of the month then show that month "Total Sales", "Total Quantity" and show last 12 months Sales on bar chart.

Sales.pngData Model.PNG

Regards,

Chalam.

1 ACCEPTED SOLUTION

Hi @chalam87,


I'd like to suggest you create new table to expand the date range between these date columns and build relationships to original table. After these steps, you can use new table's date as parameter to calculate.

 

Reference link:

Loans in different currencies/periods - calculate current value each loan - last month currency rate...

 

Regards,

XIaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Please any one can share dax query for thos problem .I want to dispaly previous 12 months sales including slicer month

v-shex-msft
Community Support
Community Support

Hi @chalam87,

 

You can refer to below link to know how to write a measure as the dynamic visual title:

Dynamic Titles

 

Regards,

Xiaoxin Sheng

 

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Phil_Seamark
Employee
Employee

Hi @chalam87

 

One approach is to not have a relationship between the date table you use as your slicer and your Retail Sales table.

 

This way you can create a calculated measure that you can use as s filter on your visual that allows a date range that is not filtered by the slicer table.

 

I've uploaded a cut down version here for you to have a look at

 

https://1drv.ms/u/s!AtDlC2rep7a-oD0hNMo_6maOMyVY


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi Phil_Seamark,

 

Thank you for quick reply.

 

I tried your solution it's working fine when we have only view measures based on date column in Retail Sales but in same table i have two more dates(shipdate and receiptdate).

 

If calculate based on shipdate and receiptdate, the result is giving wrong.

 

Could you please suggest me how can manage more than one date.

 

Regards,

Chalam.

Hi @chalam87,


I'd like to suggest you create new table to expand the date range between these date columns and build relationships to original table. After these steps, you can use new table's date as parameter to calculate.

 

Reference link:

Loans in different currencies/periods - calculate current value each loan - last month currency rate...

 

Regards,

XIaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Show last 12 months sales including slicer month and tables have a relationship in Power BI.How it can do with relationship.

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.