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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
350z
Helper I
Helper I

Incorrect Total

Total Value for Table on left should be 6.71, not 4.52. How can I achieve this, here is my measure applied:

 

 

ft per = (((AVERAGEA('51039 BI'[Feet Installed (ft)])) / (AVERAGEA([Total Feet (ft)])))*100)

 

 

350z_0-1712935512866.png

Thank you

1 ACCEPTED SOLUTION

 

Try this measure:

_FeetPer = 
VAR __feetPer =
AVERAGEX(
    YourTable,
    VAR __feetInst = IF(YourTable[FeetInstalled] <> 0, YourTable[FeetInstalled])
    VAR __feetTotal = IF(YourTable[TotalFeet] <> 0, YourTable[TotalFeet])
    RETURN
    DIVIDE(__feetInst, __feetTotal, BLANK()) * 100
)
RETURN
IF(
    HASONEVALUE(YourTable[LaborCode]),
    __feetPer,
    DIVIDE(
        __feetPer,
        CALCULATE(
            DISTINCTCOUNT(YourTable[LaborCode]),
            ALLSELECTED(YourTable)
        ),
        BLANK()
    )
)

 

BA_Pete_0-1713115747934.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
BA_Pete
Super User
Super User

Hi @350z ,

 

On what basis are you expecting the result to be 6.71? From what I can see, (102.61 / 2268.74) * 100 = 4.52.

Can you explain the logic you're using to get to the 6.71 figure please?

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




4.52 would be correct for an overall percentage that I'll be using on another visual. 6.71 should be the mean.

(20.13+0+0) = 20.13...

3/20.13 = 6.71

 

The table on the left will always give a total overall percentage even if specific, not all, selections are made in a slicer?

 

 

Try this measure:

_FeetPer = 
VAR __feetPer =
AVERAGEX(
    YourTable,
    VAR __feetInst = IF(YourTable[FeetInstalled] <> 0, YourTable[FeetInstalled])
    VAR __feetTotal = IF(YourTable[TotalFeet] <> 0, YourTable[TotalFeet])
    RETURN
    DIVIDE(__feetInst, __feetTotal, BLANK()) * 100
)
RETURN
IF(
    HASONEVALUE(YourTable[LaborCode]),
    __feetPer,
    DIVIDE(
        __feetPer,
        CALCULATE(
            DISTINCTCOUNT(YourTable[LaborCode]),
            ALLSELECTED(YourTable)
        ),
        BLANK()
    )
)

 

BA_Pete_0-1713115747934.png

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.