Forum Discussion
Calculating a ratio based on partial text values
- 2 years ago
Share the download link of the PBI file with the 3 visuals already built there.
a3810 , based on what I got
Divide(
Calculate( Sum(Table[Cost]), filter(Table, containsstring(Table[Service],"Initial"))) , Sum(Table[Cost]) )
or
Divide(
Calculate( Count(Table[Service]), filter(Table, containsstring(Table[Service],"Initial"))) , Count(Table[Service]) )
- a38102 years agoNew Member
Thanks Amit.
I have used the second option, however I get the error saying that 'To use special characters in a measure, enclose the entire name in brackets ( [] ) and add a ] to any closing brackets in the name.
Is the issue in my table or sheet names? Here is my input.
Divide(
Calculate( Count(Master Activity Report[Item]), filter(Master Activity Report, containsstring(Master Activity Report[Item],"Initial"))) , CountMaster Activity Report[Item]) )
Thanks so much for your response.
- a38102 years agoNew Member
And when I try:
Measure 2 = Divide(Calculate( Sum('Master Activity Report'[Item]), filter('Master Activity Report', containsstring('Master Activity Report'[Item],"Initial"))) , Sum('Master Activity Report'[Item]) )It gives a red error over "Initial"The word initial is part of the code description. Should it start with an * as it is a partial match?Thanks again.