Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a database I connect using Power Query, which brings in monthly data for analyzation and reporting. In some months I have a Revenue Code that may show up or may not. What I would like to do is create an IF function that looks for this Code and inserts a row for that Code if not present.
My current line of code: = Table.InsertRows(#"Reordered Columns", 2, {[Revenue Code="104", Date= null, kWh= null, kW= null, Charges= null, Tax= null, Total= null]})
But the problem is in months that Code 104 is created, it doubles the count further in queries. SO my thoughts were to create an If function that crerates the above data if the code is missing but ignores it if it is present.
Thank you for any assistance.
This would be much easier to solve with some sample data.
You could possibly just add a grouping to deal with the duplicate rows.
So, group by everything you need to and do a max or sum of the Date, kWh, KW, Charges etc. as required.
This should give you what you want. Again, can't be sure without seeing some sample data.
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 12 | |
| 10 | |
| 7 | |
| 6 |