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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tracytran91
Helper III
Helper III

Countrows with 2 measures from different tables

Hi friends, 

 

I have the model like this: 

 

Untitled.png

 

I would like count number of row of the table which contains: 

 

tracytran91_1-1641460894480.png

I created this measure but it does not work out:

No_Of_Row= 
              COUNTROWS(
                        SUMMARIZE(
                        F_Sales,
                        D_Date[No Month],
                        D_Client[Client Name],
                        D_Customer[Customer]
                        ,"Sales",SUM(F_Sales[Sales])
                        ,"Target",SUM(F_Target[target])
                        ))

 

Could anyone please help me to solve it?

 

Much appreciate your help. 

 

3 REPLIES 3
v-janeyg-msft
Community Support
Community Support

Hi, @tracytran91 

 

Although there are relationships between your model tables, the target and sales tables are not related, and the three dimension tables are not related, so your code can't be written like this...

vjaneygmsft_0-1641881000657.png

 
Without data it is difficult for us to provide valid code. if you can share some insensitive data samples and expected output, we can help you better.
 
Best Regards,
Community Support Team _ Janey
amitchandak
Super User
Super User

@tracytran91 , Try a measure like

countrows(F_sales,D_date[Month], D_customer[Customer], C_Client[Client Name] ,"_1" , sum(f_sales[sales]), "_2", sum(F_target[target]))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak Thank for your suggestion. 

However, it does not work out. 

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.