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.
Hello!
I'm having trouble with the Syntax for this measure:
Basically I want to the second filter in the CALCULATE+SUM function for Turnover1 (where I've highlighted yellow) to be changable, based upon the "TimePeriod" selected.
So when I select "YTD" in the Timeslice1 Slicer, it will use the appropriate "DATESBETWEEN" on the Calander table for YTD, when I've selected "YTG" it will use the "DATESBETWEEN" formula to filter the calander for YearToGo dates, etc.
I can make this work ok if I write multiple different variables for Turnover1 for each Timeframe but I'd prefer to have one variable where the Timeframe gets defined, which I can then plug into multiple different CALCULATE/SUM variables (As I will be building an entire P&L with many more Timeframes and CALCULATE/SUM Measures like this.
Hope that makes sense, any help really appreciated!
Thanks
Alex
@Anonymous,
The SWITCH function returns a scalar value, but CALCULATE filter arguments are tables (hence the error). A better approach is calculation groups. You create them in Tabular Editor (free tool), which updates the tabular model in the pbix file. You could create two calculation groups: one for Actual Version, and one for Time Period.
https://www.sqlbi.com/articles/introducing-calculation-groups/
Proud to be a Super User!
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |