Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
I'm trying create a financial statement and I'm new to PBI. I have a dimension table for my report layout that is connected to a fact table via a relationship at the line name. Some of data flowing into the rows need to be in percentage and other just numbers with commas. I created two measures sumActivity = SUM('fctMapping'[FlipActivity]), and PCTActivity = FORMAT([sumActivity],"0.0%").
.
When I bring the measures into values they populate like this:
The highlighted row represents the row that I want to show up as a percentage.
In the dimReportLayout table there is a column DataFormat that contains the identifier PCT for rows I want to show percentage, NUM for rows as numbers with commas, and NA for rows without any data.
To bring the correct format into the same column I tried creating a new measure
Solved! Go to Solution.
@RN_87 ,Measures like
FormatSwitch = SWITCH(TRUE(),SELECTEDVALUE(dimReportLayout[DataFormat]) = "PCT",
[PCTActivity],SELECTEDVALUE(dimReportLayout[DataFormat]) = "NUM"
,[sumActivity])
Please use new dynamic String format , This article has good example for what you want to do
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-the-new-dynamic-format-strings-for-measures/
@RN_87 ,Measures like
FormatSwitch = SWITCH(TRUE(),SELECTEDVALUE(dimReportLayout[DataFormat]) = "PCT",
[PCTActivity],SELECTEDVALUE(dimReportLayout[DataFormat]) = "NUM"
,[sumActivity])
Please use new dynamic String format , This article has good example for what you want to do
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-the-new-dynamic-format-strings-for-measures/
Thank you. That worked.
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
93 | |
88 | |
83 | |
76 | |
49 |
User | Count |
---|---|
145 | |
140 | |
109 | |
68 | |
55 |