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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Gionedis
Helper I
Helper I

How to Multiply rows in a table visualization

Hello guys,

 

i have a table, that the result in percentage is a measure (have column). i want to multiply the first row with all below as follows:

 

TABLE.JPG

The want column is the multiplication of the have as follow:

 

1-30.JPG

31-60.JPG

61-90.JPG

 

i have no ideia how i can do that. Can you guys help me? Thanks

4 REPLIES 4
parry2k
Super User
Super User

@Gionedis I assume you have sort or key column for each bucket, if not you need to add one and then write following measure:

 

New Measure = 
VAR __MyKey = SELECTEDVALUE ( Test[Key] )
VAR __Table = FILTER ( ALL ( Test ), Test[Key] > __MyKey )
RETURN
PRODUCTX ( 
    __Table, [My Measure] * 1 
) + 0

 

and here is the output

 

parry2k_0-1700679951260.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hello, i think im foing it wrong: for the bucket i created a column ordering:

 

bucket.JPG

 

then replicated your dax formula:

 

medida.JPG

 

the result was 0:

 

tabela.JPG

for instance, the roll rate NBV measure is something like this:

 

medida2.JPG

it goes until the Write-Off

 

Thanks

Hi @Gionedis ,

 

Please try code as below.

New =
VAR _SUMMARZIE =
    SUMMARIZE (
        ALL ( 'tfat_carteira' ),
        'tfat_carteira'[CC_AGING],
        'tfat_carteira'[AgingValue],
        "Roll Rate NBV", [Roll Rate NBV]
    )
VAR _PRODUCT =
    ADDCOLUMNS (
        _SUMMARIZE,
        "PRODUCT",
            PRODUCTX (
                FILTER ( _SUMMARIZE, [AgingValue] > EARLIER ( [AgingValue] ) ),
                [Roll Rate NBV]
            )
    )
RETURN
    SUMX (
        FILTER ( _PRODUCT, [CC_AGING] = MAX ( 'tfat_carteira'[CC_AGING] ) ),
        [PRODUCT]
    )

 

Best Regards,
Rico Zhou

 

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

Hello,

 

this time return empty.

new.JPG

 

below the formula:

formula.JPG

here the define:

 

DEFINE
    MEASURE '_Medidas'[Roll Rate NBV] = // Calculate the total NBV
VAR cc = CALCULATE(SUM(tfat_carteira[NBV]),tfat_carteira[CC_STATUS_CHANGE] IN {"ROLOU-1-30","ROLOU","ROLLBACK"})

// Get the selected aging value
VAR aging = SELECTEDVALUE(tfat_carteira[CC_AGING])

RETURN
    SWITCH (
        aging,
        "2) 1-30",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "1) On Date",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            ),
        "3) 31-60",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "2) 1-30",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            ),
        "4) 61-90",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "3) 31-60",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            ),
        "5) 91-120",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "4) 61-90",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            ),
        "6) 121-150",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "5) 91-120",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            ),
        "7) 151-180",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "6) 121-150",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            ),
        "8) WOFF",
            IFERROR(
                cc / CALCULATE(
                    SUM(tfat_carteira[NBV]),
                    tfat_carteira[CC_AGING] = "7) 151-180",
                    FILTER(
                        ALL(tdim_tempo),
                        tdim_tempo[INDEX_ANO_MES] = MAX(tdim_tempo[INDEX_ANO_MES]) - 1
                    )
                ),
                BLANK()
            )
    )
    MEASURE '_Medidas'[New] = VAR _SUMMARIZE =
    SUMMARIZE (
        ALL ( 'tfat_carteira' ),
        'tfat_carteira'[CC_AGING],
        'tfat_carteira'[AgingValue],
        "Roll Rate NBV", [Roll Rate NBV]
    )
VAR _PRODUCT =
    ADDCOLUMNS (
        _SUMMARIZE,
        "PRODUCT",
            PRODUCTX (
                FILTER ( _SUMMARIZE, [AgingValue] > EARLIER ( [AgingValue] ) ),
                [Roll Rate NBV]
            )
    )
RETURN
    SUMX (
        FILTER ( _PRODUCT, [CC_AGING] = MAX ( 'tfat_carteira'[CC_AGING] ) ),
        [PRODUCT]
    )

EVALUATE
    SUMMARIZECOLUMNS(
        "Roll Rate NBV", '_Medidas'[Roll Rate NBV],
        "New", '_Medidas'[New]
    )

 

thanks 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.