Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Reply
cosminc
Post Partisan
Post Partisan

Insert custom rows

Hi all,

is it posible to add rows in a base like this:

 

IDYearMonthClientLabelValueconcatenate ID&Client
120181cosminA11cosmin
120181cosminB11cosmin
120181cosminC11cosmin
120181cosminD01cosmin
220182cosminA02cosmin
220182cosminB12cosmin
220182cosminC12cosmin
220182cosminD02cosmin
320181anaA03ana
320181anaB03ana
320181anaC03ana
320181anaD13ana
420183anaA04ana
420183anaB14ana
420183anaC14ana
420183anaD14ana
add custom rows     
120181cosminZ01cosmin
220182cosminZ02cosmin
320181anaZ03ana
420183anaZ14ana
If(Value for C=1 ann D=1 --value for new row is 1, otherwise os 0

 

the real base has thousands of rows and need to make something for each ID&Client

any idea?

Thanks,

Cosmin

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi COSMINC,

You could try to new custom row table by DAX like below

 

custom rows =
SUMMARIZE (
    cutsom,
    cutsom[ID],
    cutsom[Year],
    cutsom[Month],
    cutsom[client],
    cutsom[concatenate ID&Client],
    "value", IF (
        CALCULATE (
            SUM ( cutsom[Value] ),
            FILTER (
                ALLEXCEPT ( cutsom, cutsom[ID] ),
                cutsom[Label] = "C"
                    || cutsom[Label] = "D"
            )
        ) = 2,
        1,
        0
    ),
    "Label", "Z"
)

17.png

Then  use selectcolumn  and union syntax to combine two table like below

Table 2 =
UNION (
    cutsom,
    SELECTCOLUMNS (
        'custom rows',
        "id", 'custom rows'[ID],
        "year", 'custom rows'[Year],
        "Month", 'custom rows'[Month],
        "client", 'custom rows'[client],
        "lable", 'custom rows'[Label],
        "value", 'custom rows'[value],
        "con", 'custom rows'[concatenate ID&Client]
    )
)

18.png

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
dax
Community Support
Community Support

Hi COSMINC,

You could try to new custom row table by DAX like below

 

custom rows =
SUMMARIZE (
    cutsom,
    cutsom[ID],
    cutsom[Year],
    cutsom[Month],
    cutsom[client],
    cutsom[concatenate ID&Client],
    "value", IF (
        CALCULATE (
            SUM ( cutsom[Value] ),
            FILTER (
                ALLEXCEPT ( cutsom, cutsom[ID] ),
                cutsom[Label] = "C"
                    || cutsom[Label] = "D"
            )
        ) = 2,
        1,
        0
    ),
    "Label", "Z"
)

17.png

Then  use selectcolumn  and union syntax to combine two table like below

Table 2 =
UNION (
    cutsom,
    SELECTCOLUMNS (
        'custom rows',
        "id", 'custom rows'[ID],
        "year", 'custom rows'[Year],
        "Month", 'custom rows'[Month],
        "client", 'custom rows'[client],
        "lable", 'custom rows'[Label],
        "value", 'custom rows'[value],
        "con", 'custom rows'[concatenate ID&Client]
    )
)

18.png

Best Regards,

Zoe Zhi

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks,

very very helpfull!

Cosmin

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.