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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rdallimore
Frequent Visitor

Measure with conditions

Hi good people of the community!,

 

im looking to create a set of measures for my data set so i can capture trend on an ongoing basises inanother table - but im having a little trouble with the measures - effectivly what i want to achieve is:

 

NewMeasure = DISTINCTCOUNT(from this table[of these things]) WHERE (this table[this column]) value is Equal to "x"

 

am i right in thinking i should wrap everything in a CALCULATE(DISTINCTCOUNT(table&row),CALCUCLATE(SUM(table&row),condition))

 

any help applreciated

 

Rich

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rdallimore

 

Yes, based on the high level details you have given in the post, yes, you can use CALCULATE function with the DISTINCTCOUNT or SUM along with FILTER() as needed. For example:

CALCULATE(DISTINCTCOUNT(Sales[Order ID]), FILTER(Sales,Sales[Product ID]=100))

 

Post more details with sample data if you need exact solution.

 

Thanks

Raj

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @rdallimore

 

Yes, based on the high level details you have given in the post, yes, you can use CALCULATE function with the DISTINCTCOUNT or SUM along with FILTER() as needed. For example:

CALCULATE(DISTINCTCOUNT(Sales[Order ID]), FILTER(Sales,Sales[Product ID]=100))

 

Post more details with sample data if you need exact solution.

 

Thanks

Raj

Many thanks Raj - it was the FILTER that i needed.

 

many thanks

 

Rich

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors