Retail · Power BI
Transforming kobo values and date types in Power Query for clean reporting
Independent grading: 100/100(verify, opens in a new tab)
Problem
Nura Ibrahim at Meridian Retail (simulated retailer) flagged that the orders table stored monetary values in kobo, and that the created_at column carried a time component that was not needed for the analysis. Both issues needed to be resolved in Power Query before any visuals could be built.
What I did
In the retail orders M code, I used Table.TransformColumnTypes to convert the created_at column to type date, stripping the time component cleanly at the query stage rather than in a calculated column. A new naira column was added with Table.AddColumn using each [total_cents]/100, then renamed to Total (NGN) via Table.RenameColumns. A final type-cast step was applied to the new column to confirm it as type number, ensuring the field behaves correctly in any downstream measure or visual. Doing the conversion and renaming in Power Query rather than in DAX means the clean column is available across the whole model without an additional measure.
Finding
The transformation produced a correctly typed naira column confirmed as live in the model, with the time component removed from the date field.
Outcome
Nura's model now holds a ready-to-use Total (NGN) column in naira and a clean date field, so revenue visuals can be built without any further unit or type handling.
Next step
A follow-up check on whether any total_cents values are null or negative would confirm whether the division step produces any unexpected nulls or negative naira figures that could distort revenue totals.
- Power Query M code for column transformation and type casting
- Kobo-to-naira unit conversion in Power Query
- Schema-scoped table navigation in Power Query M