Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have my clustered column chart working just fine!
I have my Rev and Rev SamePeriodLastYear measures.
Rev is just a sum… and the other measure uses the function SAMEPERIODLASTYEAR.
And then I just play with my filter YEAR:
It works fine, my issue is with the legends. It is not very nice seeing this legend:
I want to see as legend; 2023 2022 (when 2023 is selected) and 2022 2021 (when 2022 is selected).
Is this even possible?
thanks.
Solved! Go to Solution.
Hi @ovonel ,
You can put your fiscal year field into Legend and create a measure to return the revenue for the selected year and revenue for the previous year in the selected year.
Sample data
For the slicer, you fiscal year field should come from a separate table, not related to the main table or the calendar table.
Year for slicer = DISTINCT('Table'[Year])
Create a measure like this.
Measure = CALCULATE(SUM('Table'[Rev]),FILTER('Table',[Year]=SELECTEDVALUE('Year for slicer'[Year])||[Year]=SELECTEDVALUE('Year for slicer'[Year])-1))
The year of the slicer is from table [Year for slicer]. The result is as follows.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ovonel ,
You can put your fiscal year field into Legend and create a measure to return the revenue for the selected year and revenue for the previous year in the selected year.
Sample data
For the slicer, you fiscal year field should come from a separate table, not related to the main table or the calendar table.
Year for slicer = DISTINCT('Table'[Year])
Create a measure like this.
Measure = CALCULATE(SUM('Table'[Rev]),FILTER('Table',[Year]=SELECTEDVALUE('Year for slicer'[Year])||[Year]=SELECTEDVALUE('Year for slicer'[Year])-1))
The year of the slicer is from table [Year for slicer]. The result is as follows.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@ovonel , for that you have two use an independent date/Year slicer and use measure like
example
//Date1 is an independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = date(year(_max)-1,1,1)
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
Need of an Independent Table in Power BI - Exclude: https://youtu.be/lOEW-YUrAbE
User | Count |
---|---|
98 | |
90 | |
78 | |
72 | |
65 |
User | Count |
---|---|
114 | |
98 | |
96 | |
68 | |
67 |