cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gabs Frequent Visitor
Frequent Visitor

YTG months corresponding data not showing on past year. Slicer filter issues ?

I have a chart filtered with yearly slicers based on th year on the time table ('Date'[Year] ). Slicing by a specific year will allow to show :


>> the selected year monthly data GDCthiYear=SUM(TblGdc[GDC This Year])

 

>> the preceding year monthly data (using Calculate SAMEPERIODLASTYEAR GDCLastYear = calculate(TblGdc[GDC_This_Year];SAMEPERIODLASTYEAR(TblGdc[DateIndex]);all('Date'[Year]))

 

When the  current year is the selected on the slicer filter and as it is not ended, it will not show data for future months which is OK. The issue is that  even for my last years data  corresponding to those "Year to go months" on which I do have data, it will not show.


I would like to show Year-to-go monthly data on last years data (as it does not yet exist for this year future months) but i belive that the slicer on current year prevents this data from showing.

I have tried unfiltering last years data with the "all" instruction, see above, with no succes. The measure works but not corresponding future months for last year do not show.


I believe the monthly axis is itself fitered by the slicer but as I cannot put an unfiltered mesure on axis.... How could i go about it so that the chart will show the corresponding monthly info on last year data for the months still to go from this year ?.

 

Thank you for your help and ideas...

1 ACCEPTED SOLUTION

Accepted Solutions
Gabs Frequent Visitor
Frequent Visitor

Re: YTG months corresponding data not showing on past year. Slicer filter issues ?

Ok .. I finally got it..  I should have avoided using the samesperiodlastyear fonction. I finally added a condition only on the current slicer seletion as follows... Seems now simple

 

 

GDC_LastYear = calculate([GDC_This_Year];all('Date'[Year]);'Date'[Year]=values('Date'[Year])-1)

 

Thank you anyway !

4 REPLIES 4
Community Support Team
Community Support Team

Re: YTG months corresponding data not showing on past year. Slicer filter issues ?

Hi @Gabs

 

Below are some articles for your reference. If it is not your case, please share some simplified sample data and expected output. That will be helpful to provide an accurate solution.

 

https://www.sqlbi.com/articles/compare-equivalent-periods-in-dax/

https://community.powerbi.com/t5/Desktop/Month-to-Date-and-Year-To-Date/td-p/403998

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Gabs Frequent Visitor
Frequent Visitor

Re: YTG months corresponding data not showing on past year. Slicer filter issues ?

Thank you Cherie , I do not think it answers my problem. Please see below the chart ilustration of my point.

 

The red part is what i do not get to show. (It shows if year selected on the slicer is a past year where data is available for all months)

 

testchartCapture.JPGIn red what is not showing..

Gabs Frequent Visitor
Frequent Visitor

Re: YTG months corresponding data not showing on past year. Slicer filter issues ?

Ok .. I finally got it..  I should have avoided using the samesperiodlastyear fonction. I finally added a condition only on the current slicer seletion as follows... Seems now simple

 

 

GDC_LastYear = calculate([GDC_This_Year];all('Date'[Year]);'Date'[Year]=values('Date'[Year])-1)

 

Thank you anyway !

Community Support Team
Community Support Team

Re: YTG months corresponding data not showing on past year. Slicer filter issues ?

Hi @Gabs

 

Glad to hear that you've solved the issue, please accept the reply as solution, that way, other community members will easily find the solution when they get same issue.

 

Regards,

Cherie

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