
Use a calculated column when every row wants a price you’ll be able to group or filter by. Use a calculated desk when the mannequin wants a brand new set of rows. Use a measure when a price ought to recalculate as readers filter the report. In Energy BI, the choice comes all the way down to what form the outcome wants and when it ought to change.
Use a calculated column for a price on every row
Suppose your orders have an order date and a ship date. A success report wants a class equivalent to Identical Day or Later for every order. A calculated column may give every order its class and allow you to put that class in a slicer, on an axis, or in a filter.
Calculated columns are evaluated for the rows within the desk. In an Import mannequin the calculated values are saved, so further columns can enhance mannequin dimension. When the logic is a part of cleansing or making ready the supply, examine whether or not the transformation belongs in Energy Question or the supply system as a substitute.
Use a calculated desk whenever you want mannequin rows
A calculated desk is a separate desk outlined with DAX. For instance, a devoted date desk may give a mannequin a constant calendar for filtering order knowledge. As soon as the desk exists, you’ll be able to relate it to different tables and put its fields in report visuals. If each order date and ship date matter, determine which one the default calendar ought to filter. Check a cargo ordered on the finish of 1 month and shipped within the subsequent so the group can examine which interval it seems in.
A calculated desk isn’t rebuilt every time a reader adjustments a slicer. If that you must present a filtered record of the prevailing order rows, use a visible that responds to the slicer. In the event you want a mannequin object shared throughout stories, talk about whether or not the mannequin, the supply, or a typical knowledge preparation layer ought to personal it.
Use a measure for a quantity that depends upon filters
A measure is calculated for the present filter context. A Complete Gross sales measure solutions the query for whichever months, prospects, or areas the visible and slicers choose. It returns one other outcome when a reader adjustments these picks.
If a proportion adjustments when the reader selects a area, that’s usually the habits you need. If the quantity is identical for each area when it ought to vary, take a look at the mannequin relationship earlier than changing the measure with one other calculation.
Attempt the three selections on the identical instance
Think about a report that tracks late shipments. You may use a column to assign a cargo standing, a date desk to group outcomes by fiscal interval, and a measure to calculate the share of orders shipped after the promised ship date. Every object serves a definite goal.
For the late share, determine which rows depend within the denominator. Suppose a area has twenty shipped orders and 4 went out after their promised ship date. Its late share is twenty p.c. If the report additionally exhibits orders ready to ship, hold them out of that calculation until enterprise house owners agree on a separate definition. Confirm that altering areas makes use of the suitable denominator every time.
Verify a identified order first. Then examine a small date vary and a second area. A row-level classification ought to keep connected to the identical order. The measure ought to change as completely different orders enter or depart the present choice.
Maintain the mannequin simpler to keep up
Select the best place to calculate a enterprise rule and doc who owns it. Write down whether or not the outcome ought to keep connected to a row, be reused as a desk, or change when a reader filters the report. Future authors can use that take a look at earlier than transferring the logic. Connection and storage modes can have an effect on which choices can be found, particularly with dwell or DirectQuery fashions. Microsoft’s calculation choices information compares these choices and explains the place the outcomes dwell. The Energy BI newbie’s information exhibits how the mannequin matches into the reporting workflow.