
To create a calculation group in a scenario involving currency in Power BI, you would typically follow these steps:
- Currency Conversion Logic:
- Implement DAX logic for currency conversion.
- Utilize exchange rates stored in a separate table.
Let’s go through a detailed example:
Step-by-Step with example
Step 1: Create the Calculation Group
- Open Tabular Editor from Power BI.
- In Tabular Editor, right-click on Tables and select Create New > Calculation Group.
- Name the calculation group, for example, “Currency Conversion”.
Step 2: Define Calculation Items
- In the “Currency Conversion” calculation group, add calculation items for different currencies. For example:
- USD
- EUR
- GBP
- For each calculation item, define the DAX formula for the conversion. Assuming you have an exchange rate table with the columns Curren
cy Code
andRateToUSD
, your DAX might look like this:- USD:
- CALCULATE (
- SELECTEDMEASURE(),
- ‘ExchangeRates'[CurrencyCode] = “USD”
- )
- EUR:
- CALCULATE (
- SELECTEDMEASURE() * LOOKUPVALUE(‘ExchangeRates'[RateToUSD], ‘ExchangeRates'[CurrencyCode], “EUR”),
- ‘ExchangeRates'[CurrencyCode] = “EUR”
- )
- GBP:
- CALCULATE (
- SELECTEDMEASURE() * LOOKUPVALUE(‘ExchangeRates'[RateToUSD], ‘ExchangeRates'[CurrencyCode], “GBP”),
- ‘ExchangeRates'[CurrencyCode] = “GBP”
- )
Step 3: Dynamic Formatting
- To ensure your measures reflect the correct currency format dynamically, you can use the
FORMAT
function. However, dynamic formatting isn’t natively supported in calculation groups, so a workaround is necessary. - You might create measures with different formats and switch them based on slicer selection. For example:
- DAX
FORMAT( CALCULATE( SELECTEDMEASURE(), 'ExchangeRates'[CurrencyCode] = "USD" ), "Currency")
- Use a slicer to select the currency and apply this to filter the calculation group accordingly.
Example DAX for Measure Formatting:
DAX :
IF(
//Check one currency in context & not US Dollar, which is the pivot currency:
SELECTEDVALUE( DimCurrency[CurrencyName], "US Dollar" ) = "US Dollar",
SELECTEDMEASURE(),
SUMX(
VALUES(calendar[Datekey]),
CALCULATE( DIVIDE( SELECTEDMEASURE(), MAX(FactCurrencyRate[EndOfDayRate]) ) )
)
)
Format string expression
SELECTEDVALUE(
DimCurrency[FormatString],
SELECTEDMEASUREFORMATSTRING()
)
Final Steps
- Implement Slicer: Add a slicer to your report for selecting the currency.
- Apply Calculation Group: Apply the calculation group to your measures in the report.
- Testing: Test the report to ensure the currency conversion and formatting work as expected.

Calculation Groups
Part 3: Calculation groups allow for the application of a consistent hierarchy logic across multiple measures or columns.
Hierarchies
Hierarchies provide a way to organize data into a tree-like structure, with higher-level categories at the top and lower-level categories at the bottom.
Parent-Child Hierarchies
Parent-child hierarchies allow for the creation of a hierarchy where each member has exactly one parent, except for the top-level member, which has no parent.
Many-to-Many Relationships
Many-to-many relationships allow for the creation of hierarchies where a single member can have multiple parents, allowing for a more flexible and complex structure.
Advantages of calculation groups:
Decreased Redundancy: By grouping related computations into reusable calculation items, calculation groups help minimize the number of measurements required in a data model. This encourages a model that is neater and more structured.
Preventing Duplicate Logic: By defining expressions only once and using them in many calculation items, duplicate logic is prevented. This lowers the possibility of introducing errors during measure construction or modifications, in addition to simplifying maintenance.
Calculation groups are particularly useful for handling time intelligence calculations (such as YTD, QTD, and MTD) and formatting modifications like currency conversions. They enable users to quickly transition between several perspectives.
Calculation Group Restrictions:
Dependency on External Tools: As previously indicated, Calculation Groups can only be established by the use of external tools, such as Tabular Editor. Users who are uncomfortable working outside of the Power BI interface may find it difficult to employ this dependency on external applications.
Power BI’s data modeling capabilities are improved by the useful feature known as Calculation Groups. Calculation Groups let users evaluate data more effectively by eliminating measure redundancy and offering a dynamic mechanism to switch between different calculations.
Although some may find the limitation of relying on other tools to be a small nuisance, Calculation Groups offer many advantages over this minor difficulty. Power BI users may produce more succinct and manageable data models, which improves insights and decision-making, by properly utilizing Calculation Groups.
Thanks for the read, please share if any comments or suggestions!!