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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
romovaro
Responsive Resident
Responsive Resident

Dax formula comparing 2 columns

Hello

 

I have the Below table:

 

NameProject Manager / CoordinatorImplementation ConsultantRegional PMCountry Long NameCIDCUID
Client ADorottya Fernabdez  FranceNCPFNCPFFR01
Client BJohn SMith John SMithFranceASPNASPNFR01
Client BJohn SMith John SMithGermanyASPNASPNDE01
Client BJohn SMith John SMithKorea, Republic ofASPNASPNKR01
Client BJohn SMith John SMithMalaysiaASPNASPNMY01
Client BJohn SMith  RussiaASPNASPNRU01
Client B   SpainASPNASPNES01
Client BJohn SMith Ryan HughesChinaASPNASPNCN01
Client BJohn SMith  ChinaASPNASPNCN02
Client BJohn SMith  IndiaASPNASPNIN01
Client BJohn SMith Ryan HughesItalyASPNASPNIT01
Client BJohn SMith  JapanASPNASPNJP01
Client BJohn SMith  SingaporeASPNASPNSG01
Client BJodi Forester Dorottya FernabdezBelgiumASPNASPNBE02
Client CJodi Forester  Oman10000622158
Client CJodi Forester  Poland10000632159
Client CJodi Forester  Saudi Arabia10000642161
Client CJodi Forester  South Africa10000652163
Client CJohn SMith  Sweden10000662164
Client CJodi Forester  United Arab Emirates10000672167
Client D   ThailandTNSGTNSGTH01

 

I can have diff scenarios.

 

Scenario 1: Name in the  Project Manager / Coordinator column is EQUAL to Name in Regional PM column.

Scenario 2: Name in the Project Manager/Coordinator column but BLANK in the Regional PM column or viceversa. 

Scenario 3: Name in the Project Manager/Coordinator column and different Name in the Regional PM column.

Scenario 4: Name in the Regional PM column column and different Name in the Project Manager/Coordinator column.

Scenario 5: Both columns are BLANK

 

I would like to create custom formulas for every scenario using the CUID column (unique customer number) as filter.

 

Scenario 1 example: Name in the  Project Manager / Coordinator column is EQUAL to Name in Regional PM column and columns are not blank. Tried to create formula but it's not working.

 

Scenario 1 =
var tab =
CALCULATETABLE (
VALUES ( PVCEL[CUID]),
FILTER (
PVCEL,
PVCEL[Project Manager / Coordinator] = PVCEL[Regional PM]
)
)
return
CALCULATE (
COUNT ( PVCEL[CUID] ),
INTERSECT ( VALUES(PVCEL[CUID] ), tab ),
FILTER (
PVCEL,
&& PVCEL[Regional PM] <> BLANK ()
)
)

 

and the idea is to create similar formulas with the diff scenarios. Any help? thanks

 

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @romovaro ,

 

Hope I understand correctly. Please try to create the following measures:

S1 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Project Manager / Coordinator]='Table'[Regional PM]&&'Table'[Project Manager / Coordinator]<>""))

S2 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Regional PM]=""&&'Table'[Project Manager / Coordinator]<>""))

S3 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Regional PM]<>'Table'[Project Manager / Coordinator]&&'Table'[Regional PM]<>""))

S4 the same as S3

S5 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Regional PM]=""&&'Table'[Project Manager / Coordinator]=""))

Vlianlmsft_0-1646274493061.png

 


Best Regards,
Liang
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

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Please show your expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
V-lianl-msft
Community Support
Community Support

Hi @romovaro ,

 

Hope I understand correctly. Please try to create the following measures:

S1 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Project Manager / Coordinator]='Table'[Regional PM]&&'Table'[Project Manager / Coordinator]<>""))

S2 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Regional PM]=""&&'Table'[Project Manager / Coordinator]<>""))

S3 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Regional PM]<>'Table'[Project Manager / Coordinator]&&'Table'[Regional PM]<>""))

S4 the same as S3

S5 = CALCULATE(COUNT('Table'[CUID]),FILTER('Table','Table'[Regional PM]=""&&'Table'[Project Manager / Coordinator]=""))

Vlianlmsft_0-1646274493061.png

 


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

Awesome Liang. It works. Thank you so much

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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
Top Kudoed Authors