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

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

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 !

View solution in original post

4 REPLIES 4
v-cherch-msft
Employee
Employee

Hi @Anonymous

 

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

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)

 

In red what is not showing..In red what is not showing..

Anonymous
Not applicable

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 !

Hi @Anonymous

 

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.

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.