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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
robertpayne21
Frequent Visitor

Create a group of filters to reuse in subsequest measures.

Hi All,

 

I'm working on a dashboard and I'm creating some measures.  For example

 

Sales

COGS

Profit

Net Profit

GP

 

I would like to display both sold and pending on a single matrix.

 

The question is, can I avoid passing through filter conditions that are the same.  The four filters would need to be applied to each calculate statement.  Is there a more optimal method of stating the filter group once and referencing it throughout the model.  

 

i.e.

GP = CALCULATE(sum(Sample[GP]),
Sample[NUMBER]=340,
Sample[Customer]<>0,
Sample[Store_Number]<>70,
Sample[CATEGORY] = "Sold")
 
 
GP = CALCULATE(sum(Sample[Sales]),
Sample[NUMBER]=340,
Sample[Customer]<>0,
Sample[Store_Number]<>70,
Sample[CATEGORY] = "Sold")
 
 
1 REPLY 1
Syk
Super User
Super User

You could create a calculated column to fit all those requirements and reference it. Should at least make it more readable so your measures would be like

GP = CALCULATE(sum(Sample[Sales]),
Sample[include_me]="Yes")



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.