Forum Discussion
Anonymous
6 years agoNot applicable
Add rows based on condition
Hi everyone, I am looking for a solution to add new rows to my dataset. For each Month of each value of [Country Name], I need to ensure that there is a row where [Business] = "Mining". If it does ...
- 6 years ago
Hi Anonymous
In Edit queries, i create a date table as below
enter dates in box "startdate" and "enddate", then "Invoke", we can get a new table, renamed it as "date",
Then in your table, if you only have three columns, group data as below,
Then add a custom column and expand
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lc_finance
6 years agoSolution Sage
Hi Anonymous ,
I think the easiest solution is the generate a new table in DAX with all the necessary rows.
You can create a new calculated table in Power BI with the following formula:
Country by month table = GENERATEALL(VALUES(Table1[Country Name]),VALUES(Table1[Calendar]))You can then add columns to this new table and copy there any values from your previous table.
Does this help you?
LC
Interested in Power BI and DAX templates? Check out my blog at www.finance-bi.com