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
dhkhanna
New Member

How to fill each row of a measure based on a single row value? (DAX Measure for Waterfall Chart)

I have a modified data table as seen below for a Waterfall visual. This table is set-up to have an Attributes column that contains labels, and Values column that contains corresponding numeric values. Italicized columns for ValuePaid, TotalPaidTime and ValueTotal are additional measures that I have created.

LineSKValuePaidTotalPaidTimeAttributeValueValueTotal
1  Non Operating Time122013.93%
1 7540Total Paid Time754086.07%
114 Maintenance14 
1138 Changeover138 
1160 Clean / Sanitation160 
1947.18 Other947.18 
16280.82 USLE6280.82 


The table is meant to power two separate Waterfall charts. As such, I have created 2 measures as follows: 

 
ValueTotal = CALCULATE(AVERAGEX('Waterfall Table','Waterfall Table'[Value] / (365*24)), FILTER('Waterfall Table', 'Waterfall Table'[Attribute] = "Total Paid Time" || 'Waterfall Table'[Attribute] = "Non Operating Time"))

ValuePaid = CALCULATE(AVERAGEX('Waterfall Table', 'Waterfall Table'[Value]), FILTER('Waterfall Table', 'Waterfall Table'[Attribute] <> "Total Paid Time" && 'Waterfall Table'[Attribute] <> "Non Operating Time"))

As seen above, ValueTotal is calculated as [Value] / (365*24). The (365*24) is a static total that [Value] is divided by to convert the measure to be "% of grand total".

The same is required for ValuePaid, but with a dynamic denominator of [Value] for [Attribute] = [Total Paid Time] for each LineSK.

I tried creating a measure called 
TotalPaidTime = CALCULATE(AVERAGEX(FILTER('Waterfall Table','Waterfall Table'[Attribute] = "Total Paid Time"), 'Waterfall Table'[Value]) ). My thinking was that I could divide the [Value] in ValuePaid with this measure.

As seen from the sample data, this measure only populates the row where attribute itself is Total Paid Time, and not across all rows. I am therefore unable to divide the [Value] for measure ValuePaid by TotalPaidTime to get "% of grand total%", as doing so results in division by blank cells. 

How can I set-up a measure where each row of ValuePaid is divided by the TotalPaidTime i.e., a table that looks like this - 
LineSKValuePaidTotalPaidTimeAttributeValueValueTotal
527 7540Non Operating Time122013.93%
527 7540Total Paid Time754086.07%
5270.19%7540Maintenance14 
5271.83%7540Changeover138 
5272.12%7540Clean / Sanitation160 
52712.56%7540Other947.18 
52783.30%7540USLE6280.82 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @dhkhanna,

You can try to use the following measure formula to get the percent of 'current value' divided 'total value' and group by 'LineSK'.

ValuePaid =
VAR currAttribute =
    SELECTEDVALUE ( 'Waterfall Table'[Attribute] )
VAR total =
    CALCULATE (
        AVERAGE ( 'Waterfall Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Waterfall Table' ),
            'Waterfall Table'[Attribute] = "Total Paid Time"
        ),
        VALUES ( 'Waterfall Table'[LineSK] )
    )
RETURN
    IF (
        AND (
            currAttribute <> "Total Paid Time",
            currAttribute <> "Non Operating Time"
        ),
        DIVIDE (
            CALCULATE (
                AVERAGE ( 'Waterfall Table'[Value] ),
                VALUES ( 'Waterfall Table'[LineSK] )
            ),
            total
        )
    )

Regards,
Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @dhkhanna,

You can try to use the following measure formula to get the percent of 'current value' divided 'total value' and group by 'LineSK'.

ValuePaid =
VAR currAttribute =
    SELECTEDVALUE ( 'Waterfall Table'[Attribute] )
VAR total =
    CALCULATE (
        AVERAGE ( 'Waterfall Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Waterfall Table' ),
            'Waterfall Table'[Attribute] = "Total Paid Time"
        ),
        VALUES ( 'Waterfall Table'[LineSK] )
    )
RETURN
    IF (
        AND (
            currAttribute <> "Total Paid Time",
            currAttribute <> "Non Operating Time"
        ),
        DIVIDE (
            CALCULATE (
                AVERAGE ( 'Waterfall Table'[Value] ),
                VALUES ( 'Waterfall Table'[LineSK] )
            ),
            total
        )
    )

Regards,
Xiaoxin Sheng

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.