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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
TSGD2123
Helper I
Helper I

Get field value by individual query by row

Hello,

 

Is it possible to get the values from a field by resolving individual queries for exch row?

 

Example: 

 

TABLE: (read from database)

ID    NAME   PURCHASED UDs

1     JOHN     select count(*) from table a

2     MARIE    select count( distinct uds) from table b

....

 

What I need is to get the return onf each query as PURCHASED_UDs value so that I get:

ID    NAME   PURCHASED UDs

1     JOHN     7

2     MARIE    9

....

 

Thanks a lot in advance!

1 REPLY 1
BA_Pete
Super User
Super User

Hi @TSGD2123 ,

 

To implement this exactly how you're asking isn't really feasible, nor would it be efficient at all. I think the way to tackle it would be something like this:

Assuming there are three tables (ID/Name dimension, TableA, TableB), and that there is a common field among your tables (I'm going to assume [ID]) then you can send all three tables to the data model and relate the ID/Name dimension to both TableA and TableB on [ID].

Then you would create measures as follows:

_tableA_count = COUNTROWS(TableA)

_tableB_count = DISTINCTCOUNT(TableB[UDs])

_total_count = _tableA_count + _tableB_count

 

Once you have all this, you can put [ID] and [Name] from your dimension table into a table visual, then add whichever measure(s) show what you need them to.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
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.

Top Kudoed Authors