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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sglee
Frequent Visitor

Count based on criteria from 2 different table

I want to analyze trend of change from year to year

Customer20182019
AA01SatisfiedDissatisfied
BB01DissatisfiedSatisfied
CC01SatisfiedSatisfied

 

Both 2018 and 2019 are 2 different table.

The satisfaction is based on formula below

Satisfaction = IF([CSI]>=4, "Satisfied", "Dissatisfied")
 
I want to know how many from satisfied to dissatisfied and how many from dissatisfied to satisfied between 2018 & 2019
What formula can I use to analyze the trend?
 
Thank you.
4 REPLIES 4
az38
Community Champion
Community Champion

Hi @sglee 

First, obviously you need relationships between 2018, 2019 and customer tables.

I guess, the Customer field should be the key for these relationships

If Im right you could create a columns in the CustomerTable like

ColumnSatToDis = CALCULATE(Countrows('CustomerTable'), 
FILTER(ALL('CustomerTable'), 
RELATED('Table2018'[Satisfaction])="Satisfied" && RELATED('Table2019'[Satisfaction])="Dissatisfied"
)
)

and

ColumnDisToSat = CALCULATE(Countrows('CustomerTable'), 
FILTER(ALL('CustomerTable'), 
RELATED('Table2019'[Satisfaction])="Satisfied" && RELATED('Table2018'[Satisfaction])="Dissatisfied"
)
)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution

LinkedIn


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
sglee
Frequent Visitor

Hi @az38 

 

Yes, table 2018 & 2019 relationship is built by Customer Code in both table.

 

However, I unable to set up the below

RELATED('Table2018'[Satisfaction])="Satisfied" && RELATED('Table2019'[Satisfaction])="Dissatisfied"

 

az38
Community Champion
Community Champion

Hi @sglee 

what kind of error do you get?

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
sglee
Frequent Visitor

@az38 

 

The Syntax is incorrect

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.