We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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 ;). |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |