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
AdamShaw
New Member

Struggling with displaying a measure in a grouped table

Hi All,

I have the below measure (might not be the easiest way to achieve what i want):

CALCULATE(COUNT('client_status'[clientid]),
FILTER('client_status', 'client_status'[statusid] IN ({23,24,25,26})),
FILTER('client_status',[active]=TRUE),
FILTER('client_status',[clientid] in DISTINCT('Advisor Clients'[clientid])),
FILTER('client_status',[clientid] in DISTINCT('client'[id])),
FILTER('client',[deleted]=false),
FILTER('client_status', 'client_status'[userid] in DISTINCT('user'[id])))

This gives me the correct volume when I cross check against my database for a total. 
However I want to display this in a table as below:
UserVolume
A10
B1
C6
D9

Where user is the id in the 'User' table referenced. 
However the table just shows blank.
If I change the query to a specific user id it filters correctly. What am I missing to allow me to group the outcome by user?
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @AdamShaw 

 

You can try the following methods.

Gather all the columns needed for Client Table and Advisor Table into Client Status Table.

Deleted2 = LOOKUPVALUE(Client[deleted],Client[id],[clientid])
Clientid2 = LOOKUPVALUE(Advisor[clientid],Advisor[clientid],[clientid])

vzhangti_0-1639550842707.png

Measure =
CALCULATE (
    COUNT ( 'Client Status'[clientid] ),
    FILTER (
        ALL ( 'Client Status' ),
        [statusid]
            IN ( { 23, 24, 25, 26 } )
                && [active] = TRUE ()
                && [Clientid2] <> BLANK ()
                && [Deleted2] = FALSE ()
                && [user] = MAX ( 'Client Status'[user] )
    )
)

vzhangti_1-1639550922669.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @AdamShaw 

 

You can try the following methods.

Gather all the columns needed for Client Table and Advisor Table into Client Status Table.

Deleted2 = LOOKUPVALUE(Client[deleted],Client[id],[clientid])
Clientid2 = LOOKUPVALUE(Advisor[clientid],Advisor[clientid],[clientid])

vzhangti_0-1639550842707.png

Measure =
CALCULATE (
    COUNT ( 'Client Status'[clientid] ),
    FILTER (
        ALL ( 'Client Status' ),
        [statusid]
            IN ( { 23, 24, 25, 26 } )
                && [active] = TRUE ()
                && [Clientid2] <> BLANK ()
                && [Deleted2] = FALSE ()
                && [user] = MAX ( 'Client Status'[user] )
    )
)

vzhangti_1-1639550922669.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@AdamShaw , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Please try a measure like

 

CALCULATE(COUNT('client_status'[clientid]),
FILTER('client_status', 'client_status'[statusid] IN ({23,24,25,26}) && 'client_status',[active]=TRUE() && 'client_status',[clientid] in DISTINCT('Advisor Clients'[clientid]) &&
'client_status',[clientid] in DISTINCT('client'[id])),
FILTER('client',[deleted]=false()))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Tried your new measure but I get the same result. The total from the measure is fine. It just doesnt show when displayed in a table. 

 

Example data: 
Client Status Table:

clientid  statusid active user
123TRUE a
234TRUE b
346TRUE c
425TRUE b
197FALSE c
61TRUE a
724TRUE b
328FALSE a
926TRUE c


Client Table:

iddeleted
1FALSE
2FALSE
3FALSE
4TRUE
5FALSE
6FALSE
7FALSE
8FALSE
9FALSE


Advisor Table:

clientid
1
3
4
5
6
9

 


There are other columns in these tables, but not relevant to the query I am trying to write. 
I want to get a count, by user where the statusid matches my list, the client is not deleted in the client table and exists in the advisor table. In this case I would be expecting:

user 
a1
b0
c1

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!

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 Solution Authors
Top Kudoed Authors