microsoft / microsoft/Analysis-Services

BestPracticeRules/BPARules.json: Rule `PERCENTAGE_FORMATTING` incorrectly formatted

Open
#316 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
732
Forks
433
PR merge metrics
No merged PRs in 30d

Description

First of all, thank you for providing nice CI for power bi! I followed this tutorial here: https://learn.microsoft.com/en-us/power-bi/developer/projects/projects-build-pipelines

The CI Rule for PERCENTAGE_FORMATTING could be improved imo

"ID": "PERCENTAGE_FORMATTING",
"Name": "[Formatting] Percentages should be formatted with thousands separators and 1 decimal",
"Category": "Formatting",
"Severity": 2,
"Scope": "Measure",
"Expression": "FormatString.Contains(\"%\") and FormatString <> \"#,0.0%;-#,0.0%;#,0.0%\"",
"FixExpression": "FormatString = \"#,0.0%\\u003B-#,0.0%\\u003B#,0.0%\"",
"CompatibilityLevel": 1200

Problem
The expected format has the following problems

  • missing the space between the number and the % (correct scientific notation has a space between number and unit)
  • deviates from powerbi default %-formatting (which also has the space)

Suggestion

  • old: #,0.0%;-#,0.0%;#,0.0%
  • new: #,0.0\ %;-#,0.0\ %;#,0.0\ % (uses space ; also power bi default for %)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open BestPracticeRules/BPARules.json and locate the PERCENTAGE_FORMATTING rule. Update the expected and fix format strings to include the escaped spaces before the percent signs, then verify that both expressions match the suggested formatting.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.