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.
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...
Solved! Go to Solution.
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
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
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)
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |