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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
jd8766
Helper II
Helper II

Set flag if SUM of measure > 1000

Hi, I have a table that looks like the below and I am connecting via SSAS tabular..

jd8766_0-1652181468380.png



I have a measure that gets me the distinctcount of the contractID... however I somehow need to be able to filter this to only give me contracts that relate to a CompanyID that has a combined contractvalue of > 1000

So based o the above example, we know that CompanyID 1102 has a combined ContractValue of 1120.. so I somehow want to filter the below measure to only calculate where this clause is met.

Total Contracts : = count(ContractID)

I have tried the below with no luck - any ideas?

Flag =
if(SUMX (
VALUES ( Sales[CompanyID] ),
CALCULATE ( sum( Sales[ContractValue]) )
) > 1000,1,0)


Then I have tried

calculate([Total Contracts],filter(Sales,[Flag]=1))





1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @jd8766 

You can try this, create the measures below

SumPerCompanyID = SUMX(FILTER(ALL(Sales),Sales[CompanyID]=MIN(Sales[CompanyID])),Sales[ContractValue])
distinctCount = CALCULATE(DISTINCTCOUNT(Sales[ContractID]),FILTER(ALL(Sales),[SumPerCompanyID]>1000))

result

vxiaotang_0-1652422277545.png

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @jd8766 

You can try this, create the measures below

SumPerCompanyID = SUMX(FILTER(ALL(Sales),Sales[CompanyID]=MIN(Sales[CompanyID])),Sales[ContractValue])
distinctCount = CALCULATE(DISTINCTCOUNT(Sales[ContractID]),FILTER(ALL(Sales),[SumPerCompanyID]>1000))

result

vxiaotang_0-1652422277545.png

 

Best Regards,

Community Support Team _Tang

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

jsaunders_zero9
Responsive Resident
Responsive Resident

Is it as simple as just putting a filter on the visual using the filter pane?

No because it will be in a visual that will show other fields that shouldn't be filtered by this threshhold 

Helpful resources

Announcements
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.