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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Stuck with rolling up a measure! Help!

Calling all PBI Wizards,

 

I have been spinning my wheels on this for more time than I would like to admit and cannot come up with a solution. I have created a measure that is fairly straight forward and works in a table visual when it has the proper context:

 

Test = 

Var
    Max Date = 'Data'[Max Date]

var 
    Flag = if('Data'[Return] < 0, 1,0)
Return

Flag * calculate(sum('Data'[USD]), 
        FILTER('Data',
        sum('Data'[YR1_Return]) <> blank() &&
        'Data'[Flag] = "N" && 
        'Data'[Date] = Max Date))

The reason why this works in a table visual is it executing the multiplier in the context of an account, however when I remove the context of the account instead of multiplying each row by a 1 that meets the criteria, it multiplies my total amount by a 0 as there is not context for the flag variable, returning zero. 

 

I have tried a calculated column in order to execute the flag on a row level, however this does not give me the same result, however I am not sure why. 

 

My question is, how can I create a measure to roll this up as I need to use the results of this measure to generate multiple other measures. 

 

Appreciate any and all help!

 

Thanks, 

 

JMWB

 

 

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi again. 

 

I wanna see your model (I already see that it's most likely incorrect) and would also want you to describe what the measure you're after should do.

 

Thanks.

 

Best

Darek

Anonymous
Not applicable

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.