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

Need Help on Cross metrix

Hi All,

 

Can some one help me to get the desired result. Not sure if the formula is incorrect.

Data

ClassificationIdPerson
A1
A2
B1
B2
B3
C2
C3

 

Classification
A
B
C

 

Classification_dup
A
B
C

 

Result should be

ClassifiedABC
A021
B202
120

 

 

But in Power Bi its not coming as expected.

 

People = DISTINCTCOUNT(Data[IdPerson])
 
Measure = if(VALUES(Classification[Classification])=VALUES(Classification_dup[Classification]),0,CALCULATE([People],CALCULATETABLE(SUMMARIZE(VALUES(Data[IdPerson]),Data[IdPerson]),ALL(Classification),USERELATIONSHIP(Data[Classification],Classification_dup[Classification]))))

Cross selling.png

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @RanjanThammaiah ,

You can create a measure as below:

Count of Person = 
var _t1=CALCULATETABLE(VALUES('Data'[IdPerson]),FILTER(all('Data'),Data[Classification]=MAX('Classification'[Classification])))
var _t2=CALCULATETABLE(VALUES('Data'[IdPerson]),FILTER(all('Data'),Data[Classification]=MAX('Classification_dup'[Classification_dup])))
var _t3=INTERSECT(_t1,_t2)
return if(MAX('Classification'[Classification])=MAX('Classification_dup'[Classification_dup]),0,COUNTROWS(_t3))

count of person.JPG

Best Regards

Rena

Community Support Team _ Rena
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

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @RanjanThammaiah ,

You can create a measure as below:

Count of Person = 
var _t1=CALCULATETABLE(VALUES('Data'[IdPerson]),FILTER(all('Data'),Data[Classification]=MAX('Classification'[Classification])))
var _t2=CALCULATETABLE(VALUES('Data'[IdPerson]),FILTER(all('Data'),Data[Classification]=MAX('Classification_dup'[Classification_dup])))
var _t3=INTERSECT(_t1,_t2)
return if(MAX('Classification'[Classification])=MAX('Classification_dup'[Classification_dup]),0,COUNTROWS(_t3))

count of person.JPG

Best Regards

Rena

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

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.