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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tc5613213
New Member

Counting from another table that matching same columns from this table

Hi, new to power bi and try to learn from hands-on task.

 

Sample data:

Table 1 sample data (source data):

User_IDTime_dateApp_Categoryloc_Type
0001'Music''Residence'
0002'Music''Hotel'
0003'Travel''Restaurant'



Table 2 (created from the visulasation page, cross join from 2 columns from the different table)

App_Categoryloc_type
MusicResidence
MusicHotel
MusicResturant
TravelResidence
TravelHotel
TravelResturant

 

What I want to archieve is to add a count column that count the number of ourrance of both columns in table 2 in table 1:

App_Categoryloc_typeCount
MusicResidence1
MusicHotel1
MusicResturant0
TravelResidence0
TravelHotel0
TravelResturant1


Can anyone give me a hint on how to do it? Thanks!

1 ACCEPTED SOLUTION

Thank you for your response, I figured it out after reading a few related post. If anyone is wonder, this is my solution:

Count =
CALCULATE(
COUNTROWS(App_usage_trace),
FILTER(
App_usage_trace,
App_usage_trace[Base_station_type] = 'POI and App Cate'[Most_POI] &&
App_usage_trace[App_Category] = 'POI and App Cate'[App Category]
)
)

View solution in original post

2 REPLIES 2
AntrikshSharma
Super User
Super User

@tc5613213 Should be easy, can you share the mock up pbix file of the sampel data as well. 

Thank you for your response, I figured it out after reading a few related post. If anyone is wonder, this is my solution:

Count =
CALCULATE(
COUNTROWS(App_usage_trace),
FILTER(
App_usage_trace,
App_usage_trace[Base_station_type] = 'POI and App Cate'[Most_POI] &&
App_usage_trace[App_Category] = 'POI and App Cate'[App Category]
)
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.