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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
edumach
Helper I
Helper I

Create a metric that checks if a given code has different statuses

I have a field in the table that has 3 different status values. they are: ACCEPTED, EXPIRED and REFUSED.
I want to check when the same provider whose assistance number has 2 or 3 different statuses, If that happens, I answer yes or no.

edumach_0-1655147033108.png

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @edumach 

 

You can create a new column with below DAX

Column = IF(CALCULATE(DISTINCTCOUNT('Table'[Status]),ALLEXCEPT('Table','Table'[Provider],'Table'[Assistance number]))>1,"Yes","No")

vjingzhang_0-1655358135800.png

 

Or create a measure with the same code as above column. 

vjingzhang_1-1655358311998.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

4 REPLIES 4
edumach
Helper I
Helper I

@v-jingzhang ok, thank you

edumach
Helper I
Helper I

@v-jingzhang I use direct query mode, 'CALCULATE' function was not allowed as part of calculated column DAX expressions in DirectQuery models.
The metric worked. Can you help me with the column solution?

Hi @edumach 

 

I'm afraid this is not supported for a calculated column in DirectQuery mode because of the following limitation. You can refer to this document for more details. This is a modeling limitation for DirectQuery. 

 

Limitations in calculated columns: Calculated columns are limited to being intra-row, as in, they can only refer to values of other columns of the same table, without the use of any aggregate functions. 

 

So you can only use the measure solution in this scenario. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

v-jingzhang
Community Support
Community Support

Hi @edumach 

 

You can create a new column with below DAX

Column = IF(CALCULATE(DISTINCTCOUNT('Table'[Status]),ALLEXCEPT('Table','Table'[Provider],'Table'[Assistance number]))>1,"Yes","No")

vjingzhang_0-1655358135800.png

 

Or create a measure with the same code as above column. 

vjingzhang_1-1655358311998.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors