Forum Discussion
pooofy
Helper I
3 years agoFilter for Chart Based on Filter for Page
Hello~ These are the current visualisations in my dashboard. 1) Slicer for page by Date, using the "Between" Style, i.e. enter start-date, enter end-date 2) Gauge chart with the following: - V...
- 3 years ago
Hi pooofy,
I create some dummy data for demo as attached: Exercise File
Please create below measure for your chart and replace the [*Measure*] to your own
Gauge Chart Value = var maxyear = MAXX('Table', 'Table'[Date].[Year]) var minyear = maxyear -2 var result = CALCULATE([*Measure*], FILTER( ALL('Table'), 'Table'[Date].[Year] <= maxyear && 'Table'[Date].[Year] >= minyear)) return resultFeel free to let me know if any questions, thanks!
- 3 years ago
Hi pooofy,
Please try below measure in your column chart:
Column Chart Value = var maxyear = MAXX(ALLSELECTED('Table'), 'Table'[Date].[Year]) var minyear = maxyear -2 var selectedyear = SELECTEDVALUE('Table'[Date].[Year]) var result = IF( selectedyear <= maxyear && selectedyear >= minyear, CALCULATE([Measure], ALL('Table'[Date]), 'Table'[Date].[Year] = selectedyear), BLANK()) return result - 2 years ago
Hi pooofy ,
You can add constant line in the Analytics Pane, and put your [Measure] in the fx. Thanks.
isjoycewang
Solution Supplier
3 years agoHi pooofy,
Please try below measure in your column chart:
Column Chart Value =
var maxyear = MAXX(ALLSELECTED('Table'), 'Table'[Date].[Year])
var minyear = maxyear -2
var selectedyear = SELECTEDVALUE('Table'[Date].[Year])
var result =
IF( selectedyear <= maxyear && selectedyear >= minyear,
CALCULATE([Measure], ALL('Table'[Date]), 'Table'[Date].[Year] = selectedyear),
BLANK())
return result
pooofy
Helper I
2 years agoThank you again! sorry, i was trying to see if i could adapt your solution to another issue i was facing, but i couldn't. Sorry, would you know how to solve the issue in https://community.fabric.microsoft.com/t5/Desktop/Need-help-with-DAX-measure-error-for-Counta-with-criteria/m-p/3439295#M1140906 ?
Thank you so much!