Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |