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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply

How to display a chart for selected fiscal Calender

I have a slicer having  Months betweeen 'JAN-15' to 'DEC-17', i want to display a chart with month wise sales ( no YTD is required)

 

when user select Nov-17.  

chart will be updated as per fiscal calender, with dates from jul-17 to Nov-17.  

 

when user select jan-16.

chart will be updated as per fiscal calender, with dates from jul-15 to jan-16.

 

 

3 REPLIES 3
v-yuezhe-msft
Microsoft Employee
Microsoft Employee

@sajidmansoorali,

I am not very clear about how you define the data range(jul-17 to Nov-17, jul-15 to jan-16). Do you want to display last 6 month value based on slicer selection?

If so, create a Year table containing 2015,2016,2017, 2018, create a month table containing 1,2,3...12, then create a measure using similar DAX as below in your original table.

Sum of sale= 
var Ldate = date(max('Year'[Year]),max('Month'[Month]),1) //Last date

var Fdate = EDATE(Ldate,-6) //First date

var Sumsale = sum('table'[sale]) //Calculation

return

if(min('table'[Date])<fdate,
blank(),
if(min('table'[Date])>Ldate,
blank(),
Sumsale))


Reference:
https://community.powerbi.com/t5/Desktop/Show-last-13-months-based-on-user-single-slicer-selection/m...

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for giving a solution. 

 

i don't want to show last n months, i need to show only current fiscal year from july to selected month.

 

if user select any month like jan-16, then fiscal year is from jul-15 to jun-16, however i need to show a chart having months jul-15 to jan-16 only.

 

PBI DAX Q.png

waiting for any solution, please

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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