Forum Discussion
Power BI Count IF Like
- 7 years ago
MeasureCount = CALCULATE(COUNTROWS(Like);FILTER(Like;LEFT(Like[SamAccount];3)="DA_" && Like[enable]="TRUE"))
Best Regards,
Miguel
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Have you create a calculated column?
Ok i see now it works. However, that is not what i was looking for? I wanted to be able to add a measure so i can show it on a dashboard. I want to be able to Count all accounts which start with DA_ and in the enabled coloum are True. so if there are 30 accounts and only 10 are enabled it will show 10 not 30.
- ZunzunUOC7 years agoResolver III
MeasureCount = CALCULATE(COUNTROWS(Like);FILTER(Like;LEFT(Like[SamAccount];3)="DA_" && Like[enable]="TRUE"))
Best Regards,
Miguel
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - ZunzunUOC7 years agoResolver III
Ok, try with this:
MeasureCount = CALCULATE(COUNTROWS(Like);FILTER(Like;Like[enable]="TRUE"))
- Anonymous7 years agoNot applicable
But i only want to count it if it has DA_ in SamAccount?
- ZunzunUOC7 years agoResolver III
Then, change the code to:
MeasureCount = CALCULATE(COUNTROWS(Like);FILTER(Like;LEFT(Like[SamAccount];3)="DA_"))
- Anonymous7 years agoNot applicable
But that doesnt do both so i need to count the enabled accounts that match DA_?
- Anonymous7 years agoNot applicable
Thank you :)
- v-chuncz-msft7 years agoCommunity Support
Anonymous
By the way, you may help accept the solution above. Your contribution is highly appreciated.