Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Creating a meassure with filters

Hi community i know this issue is an absurd but im not figuring how to create this meassure...

 

I need to create a meassure where it calculates the count of Envios but when Entregado = N and Rendido = S

 

Heres my SQL Server Query i want to put it in power bi measure...

 

How can i do it??

 

(select count(env.EnvioID) from envios env where env.Rendido = 'S' and env.Entregado = 'N' and Anulado = 0) as CompNoEntregados,

1 ACCEPTED SOLUTION

@Anonymous,

 

Check this article and change 0 to FALSE().

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Greg_Deckler
Community Champion
Community Champion

If you can share sample/example data and your expected output, can be more specific. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490.

 

In general, you can do something like:

 

Measure = SUMX(FILTER('envios',[Rendido] = "S" && [Entregado] = "N" && [Anulado] = 0),[Some Value])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

The thing i need to achive is this!!

 

Captura.JPG

 

And its a count not a sum!!

 

Im trying to put all this values in a table with Power Bi (All the colums are generated by differents querys in SQL SERVER). So the thing i want to show now is the column "No Entregados" because i have a page filter where takes the status of Entregado = 'S' and Rendido = 'S' but know i need to know wich ones are Entregado = 'N' and Rendido = 'S'

 

Ty for the Reply!!!

 

Well, if it is a count, then you use COUNTX instead of SUMX. If you are page filtering stuff out, you might need to use ALL. So perhaps something like this:

 

Measure = COUNTX(FILTER(ALL('envios'),[Rendido] = "S" && [Entregado] = "N" && [Anulado] = 0),[Some Value])

Sample source data would really assist greatly. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Whats the meaning of [Some Value] in your sintax???

 

For what i saw the rest of the sintax is the thing i need to achive

Some column that you want to count. Could probably be any column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

It says that when i inset the new measure in the table..

 

Captura2.JPG

 

I will tell you the data type from all of that

 

EnvioID = Bigint

Entregado = Nvarchar(1)

Rendido = Nvarchar(1)

Anulado = bit

 

 

@Anonymous,

 

Check this article and change 0 to FALSE().

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors