ADVERTISEMENT
  • About
  • Advertise
  • Privacy & Policy
  • Contact
Office Learner
ADVERTISEMENT
  • Home
  • Excel
  • Word
  • PowerPoint
  • Outlook
  • Microsoft Copilot
  • Power BI
  • Microsoft 365
  • Microsoft Teams
  • OneNote
No Result
View All Result
  • Home
  • Excel
  • Word
  • PowerPoint
  • Outlook
  • Microsoft Copilot
  • Power BI
  • Microsoft 365
  • Microsoft Teams
  • OneNote
No Result
View All Result
Office Learner
No Result
View All Result
Home Power BI

Compare variance magnitudes with Number Abs in Power Query

Tanjila Rashid by Tanjila Rashid
November 28, 2026
in Power BI
0
Compare variance magnitudes with Number Abs in Power Query
0
SHARES
1
VIEWS
Share on FacebookShare on Twitter

Compare variance magnitudes with Number Abs in Power Query

Use Number.Abs in a Power Query custom column to turn a signed numeric difference into its nonnegative magnitude. For example, Number.Abs(-7) returns 7 and Number.Abs(7) also returns 7. Keep the original signed difference beside the new result, because the magnitude alone cannot tell you whether the actual amount was above or below the plan.

This worked example uses workshop supply counts in Power BI Desktop's Power Query Editor. It creates an absolute variance column for inspection, without claiming that the largest magnitude is automatically the most important business problem. Microsoft's M reference defines Number.Abs, including its handling of null. The supply data and the review decisions in this guide are original examples intended to make that definition reproducible.

Build a tiny source table

In Power BI Desktop, create an Enter Data table with three columns named Item, Planned, and Actual. Add Folders with planned 20 and actual 16, Pencils with planned 30 and actual 36, and Rulers with planned 12 and actual 12. Open the table in Power Query Editor. Set the count columns to Whole Number after confirming that the source values are valid counts rather than mixed labels.

Add a custom column named Signed variance using [Actual] – [Planned]. For the three rows, expect -4, 6, and 0. The order of subtraction matters. Actual minus planned makes a shortfall negative in this example. If a team uses the opposite convention, document that convention prominently. Absolute values will conceal a reversed subtraction, so you must check the signed result before creating the magnitude column.

Now add another custom column named Variance magnitude with Number.Abs([Signed variance]). In the custom-column expression box, enter the M expression rather than a worksheet-style Excel formula. Expect 4 for Folders, 6 for Pencils, and 0 for Rulers. Set an appropriate numeric type for the new column and retain the original inputs and signed variance for the review. Do not replace the source values with their magnitudes.

ADVERTISEMENT

Interpret the result without losing direction

Sorting Variance magnitude from largest to smallest puts Pencils first, then Folders, then Rulers. This answers which count differs most in absolute units. It does not answer which item is most expensive, which shortage disrupts the workshop, or which percentage difference is largest. Those questions require additional context and possibly different measures. A six-pencil surplus and a four-folder shortage can have very different operational consequences.

Read the top row together with Signed variance. Pencils has a magnitude of 6 and a signed variance of 6, so it is six above plan under the stated convention. Folders has a magnitude of 4 and a signed variance of -4, so it is four below plan. A useful review table keeps both facts visible. A column headed merely Difference would make readers guess whether the sign had been removed.

Do not add the magnitudes and describe that sum as the net stock change. In this table the magnitudes sum to 10, while the signed differences sum to 2. Those totals answer different questions. Ten is the total amount of deviation across the rows in count units; two is the net signed difference. Neither total describes all practical consequences without identifying the individual supplies and the intended comparison.

Handle missing and invalid data explicitly

Microsoft documents that Number.Abs(null) returns null. A missing count should not silently become a zero variance. Add a practice row with an absent Actual value and inspect how your subtraction and subsequent expression handle it. Decide whether the record should remain incomplete, be flagged for correction, or be excluded from a particular comparison. That is a data-quality decision, not a reason to assume the plan was met.

Text values can produce errors when a numeric calculation expects a number. If a cell contains pending rather than a count, inspect the source and the applied type-conversion step. Do not replace every error with zero just to obtain a clean preview. A zero magnitude communicates exact agreement in this example, which is materially different from an unknown or unparseable actual count. Preserve evidence of the problem until it is resolved.

Power Query uses M, while report measures commonly use DAX. These languages have different contexts and syntax. Number.Abs belongs to the M transformation shown here. The example targets Power BI Desktop's query editor; menus and connectors may vary across releases, and service dataflows can expose a different editing experience. Check the function reference and your environment before translating the steps into an automated refresh process.

Verify with a deliberate change

Change the Folders actual count from 16 to 24 in the practice source. After updating the query preview, its signed variance should change from -4 to 4 while its magnitude remains 4. This is the most revealing test of the transformation: opposite directions can produce the same magnitude. Confirm that the other two rows remain unchanged and that the column names still explain the difference.

For an exercise, add Markers with planned 15 and actual 9. Predict the signed variance and magnitude before refreshing. Then sort by magnitude and explain how you would distinguish the marker shortfall from the pencil surplus. A correct answer combines the nonnegative magnitude with the signed source comparison, rather than treating an absolute-value transformation as a complete decision rule.

Sources and related reading

Primary reference and scope

Split a Combined Code in Power BI Power Query

Tags: Power BIpractical guide
ADVERTISEMENT
Previous Post

Add slide numbers while leaving the title slide unnumbered

Next Post

Emphasize a short instruction with bold text in OneNote for the web

Tanjila Rashid

Tanjila Rashid

Next Post
Emphasize a short instruction with bold text in OneNote for the web

Emphasize a short instruction with bold text in OneNote for the web

ADVERTISEMENT
  • Trending
  • Comments
  • Latest
10 Microsoft 365 Copilot Features That Transform Word and Outlook in 2025

8 Hidden Excel Features That Power Users Swear By (2026 Edition)

October 8, 2026
PowerPoint Morph Transition Masterclass: Create Cinematic Animations in 2026

PowerPoint Morph Transition Masterclass: Create Cinematic Animations in 2026

October 8, 2026
Excel GROUPBY & PIVOTBY: The New Array Functions That Replace PivotTables

Excel GROUPBY & PIVOTBY: The New Array Functions That Replace PivotTables

October 8, 2026
Excel PIVOTBY Function in 2026: The Ultimate Guide to Dynamic Pivot Analysis Without Pivot Tables

Excel PIVOTBY Function in 2026: The Ultimate Guide to Dynamic Pivot Analysis Without Pivot Tables

October 8, 2026
Spreadsheet Layout

What is spreadsheet? and how it works!

0
Spreadsheet Layout

Spreadsheet Layout

0
Spreadsheet Layout

IF function of Google Sheets – usage and formula examples

0

5 Google Sheets tricks that you always need!

0
Apply strikethrough to a withdrawn instruction in OneNote for the web

Apply strikethrough to a withdrawn instruction in OneNote for the web

November 28, 2026
Remove decorative hyphens from a copied label with Power Query Text Remove

Remove decorative hyphens from a copied label with Power Query Text Remove

November 28, 2026
Remove a transition from one PowerPoint slide

Remove a transition from one PowerPoint slide

November 28, 2026
Convert an all capitals Word heading to sentence case

Convert an all capitals Word heading to sentence case

November 28, 2026

Recent News

Apply strikethrough to a withdrawn instruction in OneNote for the web

Apply strikethrough to a withdrawn instruction in OneNote for the web

November 28, 2026
Remove decorative hyphens from a copied label with Power Query Text Remove

Remove decorative hyphens from a copied label with Power Query Text Remove

November 28, 2026
Remove a transition from one PowerPoint slide

Remove a transition from one PowerPoint slide

November 28, 2026
Convert an all capitals Word heading to sentence case

Convert an all capitals Word heading to sentence case

November 28, 2026
Office Learner

OfficeLearner is a place where you can learn PowerPoint, Excel, Word Data Analysis, and other Office related programs. We provide tips, how to guide and also provide Excel solutions to your business problems

Follow Us

DMCA.com Protection Status

Browse by Category

  • Clipchamp
  • Excel
  • Google Sheets
  • Loop
  • Microsoft 365
  • Microsoft Copilot
  • Microsoft Designer
  • Microsoft Forms
  • Microsoft Loop
  • Microsoft Sway
  • Microsoft Teams
  • Microsoft Viva
  • Microsoft Whiteboard
  • OneDrive
  • OneNote
  • Outlook
  • Planner
  • Power Apps
  • Power Automate
  • Power BI
  • PowerPoint
  • SharePoint
  • Teams
  • Visio
  • Word

Recent News

Apply strikethrough to a withdrawn instruction in OneNote for the web

Apply strikethrough to a withdrawn instruction in OneNote for the web

November 28, 2026
Remove decorative hyphens from a copied label with Power Query Text Remove

Remove decorative hyphens from a copied label with Power Query Text Remove

November 28, 2026
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2022 OfficeLearner - Free Excel, PowerPoint & Word Tutorial & Online Courses

No Result
View All Result

© 2022 OfficeLearner - Free Excel, PowerPoint & Word Tutorial & Online Courses

This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.