Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Buenas tardes,
Soy principiante en PBI, y hasta ahora, he podido ir solucionando todos los problemas que se me han ido presentando. Pero en esta ocasión, llevo 3 ó 4 semanas y no hay manera de encontrarla.
Siento molestarles con esta cuestión, que me imagino que para ustedes será muy básica. Yo creo que puede ser hasta de concepto.
En fin, el problema es el siguiente:
Tengo un distinctcount muy sencillo de una columna en una variable que, cuando lo pongo en una tarjeta o en una matriz, el resultado es bueno, pero cuando esa variable la uso en una sentencia if, el resultado no es bueno.
El if también es muy simple: Si el distinctcount es <=5, debe hacer A,y si no cumple, debe hacer B. Pero cuando uso un segmentador, sea cual sea el resultado que muestra la tarjeta o la matriz, el resultado de la instrucción if, siempre da el resultado A ,(aunque sea mayor a 5)
Seguro que la solución es simple
Solved! Go to Solution.
Hi @JavierGomez
What do you mean by A and B?
Here's the sample:
Table:
The _Count measure is:
_Count = DISTINCTCOUNT('Table'[Values])
And it returens:
Then add a Measure:
Measure = IF([_Count]<=5,"A","B")
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JavierGomez
What do you mean by A and B?
Here's the sample:
Table:
The _Count measure is:
_Count = DISTINCTCOUNT('Table'[Values])
And it returens:
Then add a Measure:
Measure = IF([_Count]<=5,"A","B")
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
84 | |
63 | |
63 | |
49 | |
45 |