Safe Division with DIVIDE
Part of the Power BI Basics section of Coddy's Power BI journey. Lesson 12 of 28.
x / 0 gives Infinity. DIVIDE returns blank instead, so the visual shows nothing.
Units per Line = DIVIDE(SUM(Sales[Quantity]), COUNTROWS(Sales))Top first, then bottom. DIVIDE(a, b, 0) shows 0 instead of blank.
Challenge
EasyWrite Units per Line: the items sold divided by the number of order lines, with DIVIDE. It is checked for each store.
Try it yourself
Units per Line =| Store | Units per Line |
|---|---|
| Lisbon Riverside | |
| Porto Ribeira | |
| Madrid Centro | |
| Barcelona Gracia | |
| Berlin Mitte | |
| Total |
- Sales
- Products
- Stores
- StoreID
- Store
- City
- Country
- OpenDate
- Customers
- Dates
- Targets
All lessons in Power BI Basics
2Your First Measures
What a Measure IsCounting RowsAverage, Min and MaxCounting Distinct ThingsMeasures Can Do MathSafe Division with DIVIDEMeasures Use Other MeasuresRecap - The Numbers Mia Wants