Format Currencies In LuckyTemplates Using DAX

This tutorial will focus on currency conversions and how to format these converted currencies using DAX in LuckyTemplates. You may watch the full video of this tutorial at the bottom of this blog.

In this example, Sales will be used to run a report based on different currencies from World Wide Importer’s data.

Table of Contents

Assumptions Used

These are the assumptions that you should remember in this remodelling:

Format Currencies In LuckyTemplates Using DAX

Creating The Currency Table In Excel

For the Currency Rate Dimension table, Microsoft Excel will be used.

You can see 19 various currencies shown in the Excel table:

Format Currencies In LuckyTemplates Using DAX

The Format column is used to pick a currency that a user selects. The Leading Text column specifies the currency. The Sort Order column manages what the user wants to see first.

If you bring this table into LuckyTemplates, it lands in the Dim Currency Rates table.

Format Currencies In LuckyTemplates Using DAX

You can sort the currency table by Sort Order instead of having an alphabetical arrangement. Here’s how to do it:

First, click the header of the column and then change it to Sort Order.

Format Currencies In LuckyTemplates Using DAX

The ticker in Dim Currency Rates table must match the ticker in Fact Currency Rates table.

This is important because in the data model, the Dim and Fact Currency Rates table must be related based on the ticker.

Format Currencies In LuckyTemplates Using DAX

In previous tutorials, you had a Sales measure that converted all the Sales based on the chosen currency.

Now, looking at the table, all Sales were converted to various currencies. You can also see that the Total column is erroneously summing up all the Sales value which is wrong since different currencies can’t be summed up.

Format Currencies In LuckyTemplates Using DAX

This table’s format is not helpful for users since it’s confusing.

The Total Sales measure must be formatted appropriately. It must follow the format from the Excel file that was imported. This is what it should look like:

Format Currencies In LuckyTemplates Using DAX

The Converted Sales and the Formatted Sales have the same numerical value, but the latter looks better with the proper currency symbols. So, you need to remove the Converted Sales since it’s unnecessary.

DAX Code For The Formatted Sales Measure

Next, create the DAX code.

Format Currencies In LuckyTemplates Using DAX

The first variable in the measure, MeasureToFormat, can be dynamic. It correctly converts and formats what the user wants to see, such as Sales or Profit.

The Currency Selected measure was used earlier. It is a coming from the Dim Currency Rates table.

Format Currencies In LuckyTemplates Using DAX

If you take off Full Name in the Fields’ Column, and select more than one currency, the Formatted Sales defaults to USD because it doesn’t know what to convert to with only one measure.

Format Currencies In LuckyTemplates Using DAX

Looking back at the DAX formula, the next two variables are two functions put together. One is for the Format and the other for the Leading Text.

Format Currencies In LuckyTemplates Using DAX

The Leading2 variable is for the Leading Text in case there are any.

Format Currencies In LuckyTemplates Using DAX

In the FormatedMeasure variable, you should use the function with MeasureToFormat, and then format it based on the LOOKUPVALUE.

Format Currencies In LuckyTemplates Using DAX

This measure is taking the converted Sales, finding what currency you want to convert it to, going to the currency rates tables, and finding the format.

Also, look for Leading Text just in case there are any.

That’s how you achieve the Formatted Sales.

Now, go back to the Formatted Sales measure. Take out the IF statement because it’s unnecessary. All you need is FinalFormat.

Format Currencies In LuckyTemplates Using DAX

After that, drag the Full Name into the Row section and you’ll see the Total Sales formatted in different currencies.

Format Currencies In LuckyTemplates Using DAX

If you click the expand button, you can see all the Sales in that currency.

Format Currencies In LuckyTemplates Using DAX

Fixing Blank Data In The Sales Table

Check if there is blank data in your sales table. These are entries that only show the currency with no amount.

Format Currencies In LuckyTemplates Using DAX

If you find blank data or entries, go back to the Formatted Sales measure and add this variable and function:

Format Currencies In LuckyTemplates Using DAX

Once that’s done, you won’t see blank data in your table anymore.


Multiple Currency Logic In LuckyTemplates – A LOOKUPVALUE Example
LuckyTemplates Exchange Rates: An Update To Multiple Currencies Management
Implementing DAX Measure Groups Into Your Reports – A LuckyTemplates Modeling Review

Conclusion

With these steps, your currency conversion in LuckyTemplates is complete.

In this tutorial, you just put together LOOKUP functions, different user selections, formatting measures, and a bit of data modelling to appropriately format the currency of your Sales.

This method can be used in currency conversions in LuckyTemplates to clear up your sales table and make the presentation better for you and the users.

All the best,

Leave a Comment

Excel Hücrelerini Metne Sığdırma: 4 Kolay Çözüm

Excel Hücrelerini Metne Sığdırma: 4 Kolay Çözüm

Excel hücrelerini metne sığdırmak için güncel bilgileri ve 4 kolay çözümü keşfedin.

Bir Excel Dosyasının Boyutu Nasıl Küçültülür – 6 Etkili Yöntem

Bir Excel Dosyasının Boyutu Nasıl Küçültülür – 6 Etkili Yöntem

Bir Excel Dosyasının Boyutunu Küçültmek için 6 Etkili Yöntem. Hızlı ve kolay yöntemler ile verilerinizi kaybetmeden yer açın.

Pythonda Self Nedir: Gerçek Dünyadan Örnekler

Pythonda Self Nedir: Gerçek Dünyadan Örnekler

Python'da Self Nedir: Gerçek Dünyadan Örnekler

Rde Bir RDS Dosyası Nasıl Kaydedilir ve Yüklenir

Rde Bir RDS Dosyası Nasıl Kaydedilir ve Yüklenir

R'de bir .rds dosyasındaki nesneleri nasıl kaydedeceğinizi ve yükleyeceğinizi öğreneceksiniz. Bu blog aynı zamanda R'den LuckyTemplates'a nesnelerin nasıl içe aktarılacağını da ele alacaktır.

İlk N İş Günü Tekrar Ziyaret Edildi – Bir DAX Kodlama Dili Çözümü

İlk N İş Günü Tekrar Ziyaret Edildi – Bir DAX Kodlama Dili Çözümü

Bu DAX kodlama dili eğitiminde, GENERATE işlevinin nasıl kullanılacağını ve bir ölçü başlığının dinamik olarak nasıl değiştirileceğini öğrenin.

LuckyTemplatesda Çok İş Parçacıklı Dinamik Görsel Tekniği Kullanarak Öngörüleri Sergileyin

LuckyTemplatesda Çok İş Parçacıklı Dinamik Görsel Tekniği Kullanarak Öngörüleri Sergileyin

Bu eğitici, raporlarınızdaki dinamik veri görselleştirmelerinden içgörüler oluşturmak için Çok Kanallı Dinamik Görseller tekniğinin nasıl kullanılacağını kapsayacaktır.

LuckyTemplatesda İçeriği Filtrelemeye Giriş

LuckyTemplatesda İçeriği Filtrelemeye Giriş

Bu yazıda, filtre bağlamından geçeceğim. Filtre bağlamı, herhangi bir LuckyTemplates kullanıcısının başlangıçta öğrenmesi gereken en önemli konulardan biridir.

LuckyTemplates Çevrimiçi Hizmetindeki Uygulamaları Kullanmak İçin En İyi İpuçları

LuckyTemplates Çevrimiçi Hizmetindeki Uygulamaları Kullanmak İçin En İyi İpuçları

LuckyTemplates Apps çevrimiçi hizmetinin çeşitli kaynaklardan oluşturulan farklı raporların ve içgörülerin yönetilmesine nasıl yardımcı olabileceğini göstermek istiyorum.

Fazla Mesai Kâr Marjı Değişikliklerini Analiz Edin - LuckyTemplates ve DAX ile Analitik

Fazla Mesai Kâr Marjı Değişikliklerini Analiz Edin - LuckyTemplates ve DAX ile Analitik

LuckyTemplates'da ölçü dallandırma ve DAX formüllerini birleştirme gibi teknikleri kullanarak kâr marjı değişikliklerinizi nasıl hesaplayacağınızı öğrenin.

DAX Studioda Veri Önbellekleri İçin Materyalleştirme Fikirleri

DAX Studioda Veri Önbellekleri İçin Materyalleştirme Fikirleri

Bu öğreticide, veri önbelleklerini gerçekleştirme fikirleri ve bunların DAX'ın sonuç sağlama performansını nasıl etkilediği tartışılacaktır.