Forum Discussion
Tabular Editor - Calculation group breaking
Hello v-henryk-mstf
Thanks for the response. I've read through the linked article and it doesn't provide any answers to my current issue.
I'll provide a step-by-step of what I did below, but first I'll outline the problem I am trying to solve in case there is an alternate solution:
Any power bi report for my company that includes currency values needs to have the values reported in 3 differenct currencies: GBP, USD, EUR. These used fixed rate mofidiers (GBP*1.34 for EUR, GBP*1.6 for USD) which makes it a bit simpler than live currency rates.
Creating sales reports means a lot of currency related measures. Calculation groups in tabular editor are ideal for reducing the complexity and logic duplication for converting these measures into USD/EUR.
However, there are multiple visuals that will includes currency measures and non-currency measures (eg. revenue and percent to target in the same visual). I am trying to find a way to have calculation items affect specific measures in a visual/across a report. Naming each measure specifically will be time consuming and require a lot of upkeep so I wanted a faster way to do this. I thought that checking the current formatting of the measure was a neat solution because anything that is already formatted as a currency should be treated as such by these calculation items.
Here are the steps I took to try to put this into action (i tested this in a new desktop report to remove any report specific variables):
- Create blank power bi desktop and load in a table (used Date dimension)
- Create a measure – Sum_Val, format as GBP/default currency
- Open tabular editor, create calculation group called ‘Currency Formatter’, add calculation item called USD
- Enter the DAX Expression
- Save in tabular editor and refresh on report page
- Add visuals to show the measure value and the Currency Formatter as a slicer
- Select the Slicer option USD. A CMD prompt briefly appears then the following error is given on the visual
- This also seems to perenially break the tablular editor calculation group functionality. E.g. If i add a new Calcultion item or edit and existing one to SELECTEDMEASUREFORMATSTRING() to try and see the formatting of the measure, I still get the original measure value and not the format string
Thanks in advance for any help and advice