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

Getting Error: calculation error in measure

CI_DIST = CALCULATE (DIVIDE (( (SUM('SCORECARD (2)'[CI_3_AVG])/SUM('RR_SCORECARD_IND_SUMMARY (2)'[CI_3_CAT])) * SUM('SCORECARD(2)'[CI_DIST_YTD]) ) , SUM('SCORECARD (2)'[CS_CURR])),'RR_SCORECARD_IND_SUMMARY (2)'[CAT] <> {40,50,52,53})
 
I am trying to do a DIVIDE on all of the rows in table scorecard omitting rows where CAT where is 40, 50, 52, 53. I am getting an error table of mutiple values was supplied where a single value was expected. What am I doing wrong ?
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @TahniatMansoor 

please use

CI_DIST =
CALCULATE (
    DIVIDE (
        (
            (
                SUM ( 'SCORECARD (2)'[CI_3_AVG] )
                    / SUM ( 'RR_SCORECARD_IND_SUMMARY (2)'[CI_3_CAT] )
            )
                * SUM ( 'SCORECARD(2)'[CI_DIST_YTD] )
        ),
        SUM ( 'SCORECARD (2)'[CS_CURR] )
    ),
    NOT ( 'RR_SCORECARD_IND_SUMMARY (2)'[CAT] IN { 40, 50, 52, 53 } )
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @TahniatMansoor 

please use

CI_DIST =
CALCULATE (
    DIVIDE (
        (
            (
                SUM ( 'SCORECARD (2)'[CI_3_AVG] )
                    / SUM ( 'RR_SCORECARD_IND_SUMMARY (2)'[CI_3_CAT] )
            )
                * SUM ( 'SCORECARD(2)'[CI_DIST_YTD] )
        ),
        SUM ( 'SCORECARD (2)'[CS_CURR] )
    ),
    NOT ( 'RR_SCORECARD_IND_SUMMARY (2)'[CAT] IN { 40, 50, 52, 53 } )
)
technolog
Super User
Super User

Hi! You must use CALCULATE twice inside DIVIDE:

CI_DIST + DIVIDE( CALCULATE(....), CALCULATE(....) )

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.

Top Solution Authors