cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jr3151006
Helper IV
Helper IV

DAX Help - how to add another condition on the current filter

Hi,

can someone help me to add a second condition filter??
I tried many time in different ways but no sucess.

 

MeasureXYZ = CALCULATE(
			DISTINCTCOUNT ( TABLE1[Número] ),
							FILTER(
								VALUES(
									TABLE1[Date]),TABLE1[Date]=CALCULATE([Measure-LatestDate],all(TABLE1[Date]))))

 

 

I need also add the following 'FIELD' + 'Condition' as bellow:

 

TABLE1[Consider]="Inativo"

 

 

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @jr3151006 ,

 

According to the error message you provided:

A single value for collumn 'Consider' in table TABLE1 cannot be determined.

I think the problem is caused by the field 'Consider' in table TABLE1 not outputting a unique value in the current context of your metric, and after checking your code, I think the problem is in this code snippet.

TABLE1[Date]=CALCULATE([Measure-LatestDate],all(TABLE1[Date]))

If it is convenient, you need to make sure that the parameter [Measure-LatestDate] placed here is a metric or a calculated column? If it is a calculated column, you need to avoid the error by nesting the functions as described in the error description, and if it is a metric, then we can make sure that the output of the metric is an aggregate value, and you can upload the source data to us to check the problem in detail.

Refer to:

MINX function (DAX) - DAX | Microsoft Learn

MAXX function (DAX) - DAX | Microsoft Learn

SUMX function (DAX) - DAX | Microsoft Learn

COUNTX function (DAX) - DAX | Microsoft Learn

 

Best Regards,

Liu Yang

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

vicky_
Solution Supplier
Solution Supplier

use the && in the filter condition.

So it would look something like CALCULATE(... FILTER(VALUES(Table), condition1 && condition2))...

oh no....

A single value for collumn 'Consider' in table TABLE1 cannot be determined. This can happen when a measure formula refers to a collumn that contais many values without specifying an aggregation such as min, maxm countm or sum to get a single result

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.