Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a spreadsheet which gets updated weekly and then have a dashboard in PowerBI. I want to be able to Query coloum 3 for all names like DA_ and then count coloum 4 for enabled/disabled
Is this possible?
Solved! Go to Solution.
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.
Hi @Anonymous , Could you share your origin data?
Thanks.
Thats what the excel is like?
Ok, you can create a calculated column like this:
enable = IF(LEFT(Like[SAMACCOUNT];3)="DA_";"TRUE";"FALSE")
I recognize what you mean with count.
Best Regards,
Miguel
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Getting the following error. Even if i change SAMACCOUNT in the query to Column3 it gives the same error?
"like" is your table name?
The table in this instance is called "test" but even that does not work?
Ok, I see two wrong things:
Otherwise, I test the code and works fine. Give me your feedback and see it.
Ok so i have named the coloums and the table? and it is still the same error? could you show your example?
Could you change ";" per ","?
So that seems to of fixed the ; issue. However it doesn't seem to allow me to count the enabled accounts?
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.
Ok, try with this:
MeasureCount = CALCULATE(COUNTROWS(Like);FILTER(Like;Like[enable]="TRUE"))
But i only want to count it if it has DA_ in SamAccount?
Then, change the code to:
MeasureCount = CALCULATE(COUNTROWS(Like);FILTER(Like;LEFT(Like[SamAccount];3)="DA_"))
But that doesnt do both so i need to count the enabled accounts that match DA_?
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.
Thank you 🙂
@Anonymous
By the way, you may help accept the solution above. Your contribution is highly appreciated.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |