Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi, I need some help with a calculated column.
Following are the details:
client_id | survey_id | comment_id | comment_text | Count of Comments |
123 | 234782 | 34835 | kjsysdihskf | 3 |
123 | 234782 | 357545 | fghfdhh | 3 |
123 | 234782 | 534535 | gfhfghdf | 3 |
123 | 57884 | 49594 | xvxvsd | 1 |
667 | 438534 | 434875 | xvcvxv | 2 |
667 | 438534 | 4367685 | fhdssh | 2 |
9056 | 562532 | 6698734 | xvsgsg | 1 |
My goal is to calculate the count of comments for each survey. I could achieve this using the below calc column on my sample data. However, my real data comes from direct query and I am not able to use CALCULATE as it is not allowed with direct query. Is there a way or different approach to get this done ?
Appreciate your prompt help.
-SN
Hi @Anonymous,
AFAIK, most of calculation DAX functions has been limited to use in direct query mode. You can use measure formula instead.
Measure =
CALCULATE (
COUNTROWS ( VALUES ( 'Table'[comment_id] ) ),
ALLSELECTED ( 'Table' ),
VALUES ( 'Table'[client_id] ),
VALUES ( 'Table'[survey_id] )
)
Regards,
Xiaoxin Sheng
Hi @Anonymous ,
hope it helps, see figure:
Regards FrankAT
@FrankAT Thanks for reply. The count column in my sample data is the result of the calculated column. I want that to be replicated for a direct query.
User | Count |
---|---|
97 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
96 | |
95 | |
64 | |
57 |