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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Need to unique value in a column and combine with another to produce a count

I'm trying to get a simple count for a Card visual.   I have the following table:

 

Training_Location__cTraining_Class_Date_Code
HQ1/3/2018-Class 1
HQ1/3/2018-Class 1
Customer Premises1/9/2018-Class 1
Customer Premises1/9/2018-Class 1
HQ1/12/2018-Class 1
HQ1/12/2018-Class 1
Customer Premises3/12/2018-Class 1
Customer Premises3/12/2018-Class 1
Customer Premises3/12/2018-Class 1
HQ5/25/2018-Class 1
HQ5/25/2018-Class 1
HQ5/25/2018-Class 2
HQ5/25/2018-Class 2
Customer Premises5/31/2018-Class 1
Customer Premises5/31/2018-Class 1
HQ8/31/2018-Class 1
HQ8/31/2018-Class 1
HQ8/31/2018-Class 2
HQ8/31/2018-Class 2

 

Essentially, I'm looking to get a total of the number of classes that were conducted at each location on each date - building a Card visual for each.  There can be training classes on the same date at both location types, and there can be multiple classes at each location on the same date.  The Training_Class_Date_Code provides the unique identifier for the date and the Training_Location_c provides the unique location. 

 

I've tried to use visual filters in a bunch of different ways, but continually end up with a HQ = 12, Customer Premises = 7.  What I want to to have the Card visual show HQ = 6, Customer Premises = 3.

 

Effectively this table:

Training_Location__cTraining_Class_Date_Code
HQ1/3/2018-Class 1
Customer Premises1/9/2018-Class 1
HQ1/12/2018-Class 1
Customer Premises3/12/2018-Class 1
HQ5/25/2018-Class 1
HQ5/25/2018-Class 2
Customer Premises5/31/2018-Class 1
HQ8/31/2018-Class 1
HQ8/31/2018-Class 2

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I answered my own question.  Created a new merged column

 

= Table.AddColumn(#"Inserted Merged Column", "Merged_TCDateCode_TLocation", each Text.Combine({[Training_Class_Date_Code], [Training_Location__c]}, "-"), type text)

 

Then used that result to do the Count (Distinct) from.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I answered my own question.  Created a new merged column

 

= Table.AddColumn(#"Inserted Merged Column", "Merged_TCDateCode_TLocation", each Text.Combine({[Training_Class_Date_Code], [Training_Location__c]}, "-"), type text)

 

Then used that result to do the Count (Distinct) from.

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.