Forum Discussion
Grouping to include missing values
- 2 years ago
Found a solution:
select id, review_name, updated_dt,
(select count(*) from
ara.review_entry re
where re.review_id = r.id and re.review_decision = 'APPROVED'
) as approved,(select count(*) from
review_entry re
where re.review_id = r.id and re.review_decision = 'REVOKED'
) as revoked,(select count(*) from
review_entry re
where re.review_id = r.id and re.review_decision = 'PENDING'
) as pendingfrom review r
Hi tantle61 ,
Please have a try.
=IIF(Count(Fields!Status.Value, "DataSet1", Recursive) = 0, 0, Count(IIF(Fields!Status.Value = "REVOKED", 1, Nothing), "DataSet1", Recursive))
In this example, is the name of the dataset that contains the data you want to count. The function is used twice: once to check if there are any records for the “REVOKED” category, and again to count the number of records for the “REVOKED” category if there are any. The function is used to return a value of 0 if there are no records for the “REVOKED” category.DataSet1CountIIF
You can modify this expression to count the number of records for other categories as well. Simply replace with the name of the category you want to count."REVOKED"
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.