Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have my clustered column chart working just fine, with Rev and Rev SamePeriodLastYear.
Measures:
(Rev is just a sum… and the other measure uses the function SAMEPERIODLASTYEAR.)
In my report I use the YEAR filter:
It works fine, my issue is with my legends:
I want to see as legend; 2023 2022 (when 2023 is selected) and 2022 2021 (when 2022 is selected). (or at least static/generic like "selected year" "previous year")
Is this even possible? The legend section doesn't have a 'function' option to make it dynamic
Solved! Go to Solution.
Hi @Anonymous ,
Here I create a sample to have a test. In my sample, data is from 2020/01/01 to 2023/01/09. I suggest you to create an unrelated DimYear table to create the slicer. My data model is as below.
Measure:
Rev =
VAR _SELECT =
SELECTEDVALUE ( SelectYear[Year] )
RETURN
IF (
SELECTEDVALUE ( DimDate[Year] )
IN { _SELECT, _SELECT - 1 },
SUM ( 'Table'[Value] )
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Here I create a sample to have a test. In my sample, data is from 2020/01/01 to 2023/01/09. I suggest you to create an unrelated DimYear table to create the slicer. My data model is as below.
Measure:
Rev =
VAR _SELECT =
SELECTEDVALUE ( SelectYear[Year] )
RETURN
IF (
SELECTEDVALUE ( DimDate[Year] )
IN { _SELECT, _SELECT - 1 },
SUM ( 'Table'[Value] )
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , I doubt rename measure dynamically, What You can try is have a slicer on an independent table
try like
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max = maxx(allselected(Date1),Date1[Year])
var _min = _max -1
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Year] >=_min && 'Date'[Year] <=_max))
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 10 | |
| 5 | |
| 5 |