Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX command to duplicate rows

Hello,  I am trying to find a way to duplicate rows in the fact table using DAX (Not via power Query) in a calculated column . I need rows which have count column > 1 to be duplicated by the number o...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Thank you Owen. I will try your solution out. 

     

    The test data that I have listed is just for simplicty ; The actual use case is that we have an initiatives around sales that drive revenue. Each row in the fact table represents a sale . Sometimes one of these rows can be driven by two or more initiatives ( count > 1 represents the nunber of initiatves that drove the sale). We need to attribute certain % of revenue to each initiative. Duplicating the rows would enable me to use %`s to attribute revenue. 

    P.S I gave Count as number for simplicty. actual data has count as text values  segregated by delimiter for eg DigitalMarketing/SalesDriven/EmailCampaign.  Duplicating the rows & little bit of dax will enable me to split one row and then each row will have one initiative & associated % . This will help me use it in reporting/filters etc.

     

    Initially i thought aboout calcuated table , but was not sure about it because now I will have to connect all the dimesnion table to teh new calcuated table again. The original table has values beign pulled in from teh Dim tables using Related