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

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.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.