Forum Discussion
Dynamically format measure from SSAS Tabular to Power BI
- 7 years ago
Hi Lotta
Based on my research, it is not supported in SSAS live connection mode. Below are some similar posts for your reference.
https://community.powerbi.com/t5/Desktop/Data-type-of-calculated-measures-in-Import-Mode/td-p/143923
Regards,
Cherie
Hi Lotta
Based on my test as below picture, it seems the second measure is correct. Just try again with below measure. If it is not your case, please share more details about your data sample so that we could help further on it.
Try =
IF (
MAX ( 'Statement Lines'[Line] ) = "Elimination",
Finance[Elimination_],
IF (
MAX ( 'Statement Lines'[Line] ) = "CB1 %",
FORMAT ( DIVIDE ( Finance[CB1_], Finance[Revenue_], 0 ), "##0.0 %" ),
IF (
MAX ( 'Statement Lines'[Line] ) = "EBIT %",
FORMAT ( DIVIDE ( Finance[EBIT_], Finance[Revenue_], 0 ), "##0.0 %" ),
[Report value]
)
)
)
Regards,
Cherie
Hi v-cherch-msft,
Thanks for the suggestion.
I can't get to work, though, as the MAX function does not take a string as argument.
Statement_Lines[Line] are stings.
Below a part of the SSAS Tabular model. We are using SQL Server 2016, SP1.
The users select Stement_lines[Line] on row and the measure as value.
Child is also strings.
This is an atempt to show report rows and the different values on the rows for the matching Statement_Lines[Line].
Kind regards
Lotta
- v-cherch-msft7 years agoMicrosoft Employee
Hi Lotta
Did you import the data? If so, could you share the sample file for us to check? MAX Function can be replaced with FIRSTNONBLANK Function as your second measure. Maybe you need check if measure= FORMAT(DIVIDE(FinanceFacts[EBIT_]; FinanceFacts[Revenue_]; 0); “##0.0 %”) is blank value,because in my test, the IF condition seems correct.
Regards,
Cherie
- Lotta7 years agoFrequent Visitor
Hi v-cherch-msft,
It's a live connection.
Neither the percentage measure or elinimation is empty as they are shown in Excel and in the SQL SSAS Tabular browser.
It seem to be specific to Power BI?Kind Regards
Lotta- v-cherch-msft7 years agoMicrosoft Employee
Hi Lotta
Based on my research, it is not supported in SSAS live connection mode. Below are some similar posts for your reference.
https://community.powerbi.com/t5/Desktop/Data-type-of-calculated-measures-in-Import-Mode/td-p/143923
Regards,
Cherie