Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
dblowers
Regular Visitor

Trouble formatting currency from SSAS Tabular

We're using Azure SSAS Tabular and PowerBI Pro Desktop.
From what I can see, the formatting options are not available in PB in this scenario since they are greyed out.
This means my formatting has to happen on the SSAS side.


My problem is formatting currency and percentages on the SSAS side seems to make my measures act like string data and it does not recognize it in a way where formating can manipulate it as a currency value.
On the front PB side, that means I cannot utilize options in the visuals to auto display the values or even set the number of decimals that the value displays, whether it has a $ sign, or wha the units of display will be.


I have tried different methods below but they return a value either without the $ sign or with a $ sign that cannot be formatted on the front end using the Data Label/Number of Decimals or the Unit Display settings,,,, note that the column "Revenue" shows up in the SSAS model with all values having a $ sign in front of it - hence currency.

 

YTD Revenue:=]
CALCULATE(SUM('Transactions'[Revenue]),
Transactions[CurrentYear] = 1 )

 

YTD Revenue:=
Format(CALCULATE(SUM('Transactions'[Revenue]),
Transactions[CurrentYear] = 1 ),"Currency")

 

YTD Revenue:=
Currency(CALCULATE(SUM('Transactions'[Revenue]),
Transactions[CurrentYear] = 1 ))

 

Oddly,  HERE I have a similar formula that works just find and allows me to change the number of decimals and display units in the Data Label settings:


Previous Year Previous:=
CALCULATE(SUM('Transactions'[Revenue]),
Transactions[CurrentYear] = 2 )

 

- Am I correct that I cannot format this on the PowerBI side because we are using SSAS Tabular and NOT importing the data into the report?
- How can I format the YTD Revenue measure on the SSAS side so that I can show the $ sign and format the Decimals and Display Units in the Data Value options?
- Why does one formula format correctly and not the other? Or am I totally missing something?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

As far as I remember, measures developed in SSAS should be formatted in there. I've done it countless times and it worked even in Tableau. But when I say "formatted" I don't mean using FORMAT to format the raw number.  I mean doing it in the UI, or - if you feel adventurous - in the .bim file straight in the JSON. Eeach measure has properties, the formatting string is among them.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

As far as I remember, measures developed in SSAS should be formatted in there. I've done it countless times and it worked even in Tableau. But when I say "formatted" I don't mean using FORMAT to format the raw number.  I mean doing it in the UI, or - if you feel adventurous - in the .bim file straight in the JSON. Eeach measure has properties, the formatting string is among them.

What I found was that on the SSAS tabular side, the "Properties Window" for the formula is the correct place where the data type can be designated (percent, currency, text, etc).  Rather than trying to "Format" the output withing the formula with a typing function, setting the properties of the output to a particular type still allows for some minimal control on the PowerBI side for decimal places, Display Units under the data label settings, etc.

Thaks for the clue!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.