Forum Discussion
How to Sum a Measure with an IF statement
Hi
I have a data set of Location where sometimes there is duplicate data for that location, it want to sum location if there are Utilised of Not utilised (ie count hpw may locations are utilised)
I written a measure to return if utilised or Not (1 or 0)
- Anonymous2 years ago
Thanks for the reply from MFelix , please allow me to provide another insight:
Hi Garbo62 ,I created some data:
Here are the steps you can follow:
1. Create measure.
Test = var _table1= SUMMARIZE( ALL('BI_SurveyData1'),[Accordant Suvery No],[TimeStart],"Count",[Utilised Activity Sum]) return COUNTX( FILTER(_table1,[Count]>0),[Accordant Suvery No])2. Result:
If the results above don't meet your expectations, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
2 Replies
- AnonymousNot applicable
Thanks for the reply from MFelix , please allow me to provide another insight:
Hi Garbo62 ,I created some data:
Here are the steps you can follow:
1. Create measure.
Test = var _table1= SUMMARIZE( ALL('BI_SurveyData1'),[Accordant Suvery No],[TimeStart],"Count",[Utilised Activity Sum]) return COUNTX( FILTER(_table1,[Count]>0),[Accordant Suvery No])2. Result:
If the results above don't meet your expectations, Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly