cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Community Support
Community Support

Re: Insert custom rows

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
Community Support
Community Support

Re: Insert custom rows

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

cosminc Post Partisan
Post Partisan

Re: Insert custom rows

Thanks,

very very helpfull!

Cosmin

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors