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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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
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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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