Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Dears
I would like to complete that format to include minus signs in front of negative values.
the expected result to be (-1.2m) ,(-12.5K)
Thanks,
DAX format I used:
Solved! Go to Solution.
@mhablas426 , Try this measure
FormattedFuelQuantity =
VAR Quantity = 'Fuel Formulas'[Fuel Total Quantity]
RETURN
IF (
Quantity >= 1000000,
FORMAT(Quantity, "0,,.00 M"),
IF (
Quantity >= 1000,
FORMAT(Quantity, "0,.00 K"),
IF (
Quantity <= -1000000,
FORMAT(Quantity, "0,,.00 M"),
IF (
Quantity <= -1000,
FORMAT(Quantity, "0,.00 K"),
FORMAT(Quantity, "0.00")
)
)
)
)
Proud to be a Super User! |
|
@mhablas426 , Try this measure
FormattedFuelQuantity =
VAR Quantity = 'Fuel Formulas'[Fuel Total Quantity]
RETURN
IF (
Quantity >= 1000000,
FORMAT(Quantity, "0,,.00 M"),
IF (
Quantity >= 1000,
FORMAT(Quantity, "0,.00 K"),
IF (
Quantity <= -1000000,
FORMAT(Quantity, "0,,.00 M"),
IF (
Quantity <= -1000,
FORMAT(Quantity, "0,.00 K"),
FORMAT(Quantity, "0.00")
)
)
)
)
Proud to be a Super User! |
|
I got those errors, could you assist, please Pic 1
Pic 2
Hi @mhablas426 - Can you try the below measure to report the expected result with () for negative
Formatted Value =
VAR Value = [Samperiodlast year Variance]
RETURN
IF(
ABS(Value) >= 1000000,
IF(Value < 0,
"-" & FORMAT(ABS(Value) / 1000000, "0.0") & "m",
FORMAT(Value / 1000000, "0.0") & "m"
),
IF(
ABS(Value) >= 1000,
IF(Value < 0,
"-" & FORMAT(ABS(Value) / 1000, "0.0") & "K",
FORMAT(Value / 1000, "0.0") & "K"
),
FORMAT(Value, "0.00")
)
)
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hello @mhablas426, and thank you for sharing you question with members of the Community Forum who are supportive. Remember to adhere to the decorum of the Community Forum when asking a question.
Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.
If your requirement is solved, please make THIS ANSWER a SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you. Proud to be a Super User!
Thanks, I have re-edited my message to be clear
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
12 | |
11 | |
10 | |
9 |