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.
Hello, I am trying to write with DAX the following SQL query
I know that case when equivalent is switch statement and group by is summarize but i can't get it work.
select
video,
sum(case when type=1 then 1 else 0 end) as upvote,
sum(case when type=0 then 1 else 0 end) as downvote
from votes
group by video
Does anybody know how to do it?
Solved! Go to Solution.
Hi @yios
You can try using something this below,
Click on New Table under Modelling tab and use the below expression. Replace the column names according to the one present in your dataset.
A new dataset would be created. Drag those columns in a table visual. You will get the output as the adjoining image.
Thanks,
Ani
Hi @yios
You can try using something this below,
Click on New Table under Modelling tab and use the below expression. Replace the column names according to the one present in your dataset.
A new dataset would be created. Drag those columns in a table visual. You will get the output as the adjoining image.
Thanks,
Ani
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 | |
80 | |
70 | |
59 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |