Forum Discussion
Ignore grouping if value is found
hi, joepath
Could you share your sample pbix file or some more data sample and the formula and expected output. You can upload it to OneDrive and post the link here. Do mask sensitive data before uploading.
Best Regards,
Lin
Hi v-lili6-msft
Uploaded the file on dropbox link: https://www.dropbox.com/s/emirclmot8dwm3r/msdnpbix.pbix?dl=0
In the report when I have one slicer “NewType” which contain the values (MeasureA,msdnMeasure) and one column chart.
When I select Newtype "msdnmeasure" value then column chart msdnmeasure value should show 3 not 4. Look like msdnmeasure measure applying the logic on filtered data set.
Thanks,
- v-lili6-msft7 years ago
Community Support
vahi, joepath
I have a test on your sample pbix file, and find that why the msdnmeasure value shows 4 not 3.
Filter the data manually by conditional.
From the screenshot, you could find that "ORG_ENCOUNTER_KEY"=10013729, it has two rows data and it has different "USER_KEY", so in the calculation, it will be count by 2 not 1.
If you want that when you select Newtype "msdnmeasure" value then column chart msdnmeasure value should show 3 not 4.
Please check that if you need to keep this conditional in your measure, if not, just remove the red part of the formula.
msdnNewMeasure = var _table= SUMMARIZE('Review Metrics' ,'Review Metrics'[ORG_ENCOUNTER_KEY],'Review Metrics'[Activity Date],'Review Metrics'[USER_KEY] ,"Review" ,IF(CALCULATE(COUNTA('Review Metrics'[Review Type]))= CALCULATE(COUNTA('Review Metrics'[Review Type]), FILTER('Review Metrics','Review Metrics'[Review Type]="Additional Review")),1,2)) return COUNTROWS(FILTER(_table,[Review]=1))Best Regards,
Lin
- joepath7 years ago
Helper II
v-lili6-msft After the change when I unselect "msdnmeasure" filter then it gives the count 1 not 3, so in both the condition whether we select or not it should give the result 3.
- v-lili6-msft7 years ago
Community Support
hi, joepath
If you want this measure?
msdnNewMeasure = var _table= SUMMARIZE('Review Metrics' ,'Review Metrics'[ORG_ENCOUNTER_KEY],'Review Metrics'[Activity Date],'Review Metrics'[NewType] ,"Review" ,IF(CALCULATE(COUNTA('Review Metrics'[Review Type]))= CALCULATE(COUNTA('Review Metrics'[Review Type]), FILTER('Review Metrics','Review Metrics'[Review Type]="Additional Review")),1,2)) return COUNTROWS(FILTER(_table,[Review]=1))and you could use this formula to add a new table to check what is the aggregate conditions of your requirement
Table = FILTER(SUMMARIZE('Review Metrics' ,'Review Metrics'[ORG_ENCOUNTER_KEY],'Review Metrics'[Activity Date],'Review Metrics'[USER_KEY],'Review Metrics'[NewType] ,"Review" ,IF(CALCULATE(COUNTA('Review Metrics'[Review Type]))= CALCULATE(COUNTA('Review Metrics'[Review Type]), FILTER('Review Metrics','Review Metrics'[Review Type]="Additional Review")),1,2)),'Review Metrics'[ORG_ENCOUNTER_KEY] in {10013730,10013728,10013724,10013746,10013729,10013726})Best Regards,
Lin
- joepath7 years ago
Helper II
v-lili6-msft This seems close to be what i am looking for, still has some issue while applying the other filter like dimuser.
I will work on that,
Thanks for your help.
- v-lili6-msft7 years ago
Community Support
hi, joepath
For the different conditional filter, the summary table will get different result.
You could use the same way as I provided to add a new table to check the logic.
Hope it could help you.
Best Regards,
Lin
- joepath7 years ago
Helper II
v-lili6-msft Or can we write a logic something like, create a flag in the review table and based on the grouping (activity date,user key,and org encounter key) if in the group any value found with Initial review then update all the additional review row flag with 0 and if we don't find any value in the group then update the flag with 1, and in the calculation we can use that flag to count the additional review. that will not be affected by the filter condition.
In Dax what are the function we can use to archive this?