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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
ivancespedesl
Helper I
Helper I

Filtering using a measure insidea calculate function

Im having trouble filtering something pretty basic.

 

I made a measure that gives me the "Mix":

Mix = 

COUNT('Data clientes lunes por 12 meses'[Cant_CA]) +
COUNT('Data clientes lunes por 12 meses'[Cant_CC]) +
COUNT('Data clientes lunes por 12 meses'[Cant_TC]) +
COUNT('Data clientes lunes por 12 meses'[Cant_CD]) +
COUNT('Data clientes lunes por 12 meses'[Cant_NE]) +
COUNT('Data clientes lunes por 12 meses'[Cant_PR_Vh]) +
COUNT('Data clientes lunes por 12 meses'[Cant_PR_Com]) +
COUNT('Data clientes lunes por 12 meses'[Cant_PR_Hip]) +
COUNT('Data clientes lunes por 12 meses'[Cant_PR_Tie]) +
COUNT('Data clientes lunes por 12 meses'[Cant_PR_Per]) +
COUNT('Data clientes lunes por 12 meses'[Cant_PR_LC]) +
COUNT('Data clientes lunes por 12 meses'[Cant_MC])
 
I want to make a measure where I get the amount of people (CLIENT_ID) that Mix >=2. For this i wrote the following:
 
2+ productos = CALCULATE(DISTINCTCOUNT('Data clientes lunes por 12 meses'[CLIENT_ID]),
                          FILTER('Data clientes lunes por 12 meses',[Mix]>=2)
                         )
 
Then I made a KPI visual with Date as my trend (i have an observation per day for every client) and the measure as my value.
 
Unfortunately, it didnt work. What should I do?
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @ivancespedesl 

Just adjust the formula as below:

2+ productos = CALCULATE (
    DISTINCTCOUNT ( 'Data clientes lunes por 12 meses'[CLIENT_ID] ),
    FILTER(VALUES('Data clientes lunes por 12 meses'[CLIENT_ID]),[Mix] >= 5))

Then it should work well.

If not your case, please share a simple sample pbix file and your expected output.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @ivancespedesl 

Just adjust the formula as below:

2+ productos = CALCULATE (
    DISTINCTCOUNT ( 'Data clientes lunes por 12 meses'[CLIENT_ID] ),
    FILTER(VALUES('Data clientes lunes por 12 meses'[CLIENT_ID]),[Mix] >= 5))

Then it should work well.

If not your case, please share a simple sample pbix file and your expected output.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
lc_finance
Solution Sage
Solution Sage

Hi @ivancespedesl ,

 

 

can you share an example of your Power BI with sample data?

That will make it easier to help you. You can share using OneDrive, Google Drive or a similar tool.

 

Regards

 

LC

Interested in Power BI and DAX tutorials? Check out my blog at www.finance-bi.com

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.