Forum Discussion
LRSFC_DanJ
3 years agoRegular Visitor
Using SWITCH with CALCULATE?
I'm new to Power BI so I apologise in advance if there's something obvious that I've missed. I have a couple of measures which sum values within a specific date range, to allow comparing between ...
- 3 years ago
I've cracked it. The solution was to add Fiscal year to the "Legend" of the clustered column chart. This then has the result I wanted.
LRSFC_DanJ
3 years agoRegular Visitor
amitchandak Field parameters sounds like what I wanted, but I don't seem to be able to make it work with SUM?
I tried to do this:
Selected 2018-2019 = CALCULATE(SUM('Selected half-hours to compare'[Selected half-hours to compare]), 'HH Consumption Report 2018-2022'[Date] >= DATE(2018,9,1) && 'HH Consumption Report 2018-2022'[Date] <= DATE(2019,9,1))
But it does not work, it reports an error saying that SUM cannot work with a string.
("Selected half-hours to compare" is a Field parameter)