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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jonnyA
Responsive Resident
Responsive Resident

How do I create a measure with filters?

I'm trying to create a measure with filters.

For example: my dataset has a "note_Id" and I need to figure out a way to create a measure that has my "Note_ID", but only the Note ID's that have Modifers 95 and GT.

Maybe the screenshots will help ... As you can see from the screenshots the table is only showing Note ID's that have Modifier's 95 and GT.

jonnyA_0-1611588865604.png

Continued, see how I have checked every filter that has a 95 or GT?  That is what I need to bring back in this filtered Measure I am trrying to create.

jonnyA_1-1611588967871.png

Why am i trying to do this?  Because I am going to need to divide a filtered Note ID, divided by, another Filted Note ID.

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@jonnyA I think I used the wrong column in the DAX, try this

 

Count 95 and GT = 
CALCULATE ( 
COUNTROWS ( Table ), 
Table[Modifier] IN { "95", "GT" } 
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

parry2k
Super User
Super User

@jonnyA wrap it in KEEPFILTERS

 

Another measure = 
CALCULATE ( 
COUNTROWS ( Table ),
KEEPFILTERS ( NOT ISBLANK ( Table[CPT] ) ),
KEEPFILTERS ( NOT ISBLANK ( Table[Billed_CPT] ) )
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

10 REPLIES 10
parry2k
Super User
Super User

@jonnyA try this in % calculation

 

% = DIVIDE ( COALESCE ( [95 and GT Measure], 0 ), [Denominator Measure], 0 )

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

jonnyA
Responsive Resident
Responsive Resident

@parry2k ,

Hey, thank you for your answer!  The formula did work for the %.

Another question ... is there a way to make the "95 and GT" measure show "0" when it is blank?  When "95 and GT" measure are blank the "%" is also blank.  I'm thinking if we can make the blanks show up as "0" then the % will display!  Thank you!

 

jonnyA_0-1611686456199.png

 

parry2k
Super User
Super User

@jonnyA wrap it in KEEPFILTERS

 

Another measure = 
CALCULATE ( 
COUNTROWS ( Table ),
KEEPFILTERS ( NOT ISBLANK ( Table[CPT] ) ),
KEEPFILTERS ( NOT ISBLANK ( Table[Billed_CPT] ) )
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@jonnyA try this:

 

Another measure = 
CALCULATE ( 
COUNTROWS ( Table ),
NOT ISBLANK ( Table[CPT] ),
NOT ISBLANK ( Table[Billed_CPT] ) 
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

jonnyA
Responsive Resident
Responsive Resident

My #'s are close, but not quite working.

If you look at the right matrix, where it is highlighted, i dont understand why it is showing "10" for all Note ID's?  The matrix on the left is broken down individually.

PBI Measure 2.PNG

jonnyA
Responsive Resident
Responsive Resident

@parry2k , I have another step to what I am trying to accomplish.

Part 2.

It's another measure using the same "Note_ID" with the following filters ... 

  • CPT is not Blank
  • Billed_CPT is not (Blank)

Do you know how why write a measure for that?

Thank you in advance! 🙂

jonnyA_0-1611601828869.png

 

 

parry2k
Super User
Super User

@jonnyA I think I used the wrong column in the DAX, try this

 

Count 95 and GT = 
CALCULATE ( 
COUNTROWS ( Table ), 
Table[Modifier] IN { "95", "GT" } 
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

jonnyA
Responsive Resident
Responsive Resident

@parry2k ,

 

Thank you again for all of your help today, I really appreciate it!

 

Ok, Final question ... The "Count of 95 and GT" measure.  I have many that are blank.  Is there a way to make them show as "0" when they are blank?

jonnyA_0-1611630448981.png

 

The reason I want to show "0" when blank is because I want the "% of Encounters to Telehealth" to show a %.  Where the "Count of 95 and GT" are blank, then a % does not show up.

 

Thank you! 🙂

parry2k
Super User
Super User

@jonnyA you should write a measure to filter 25 and GT

 

Count 95 and GT = 
CALCULATE ( 
COUNTROWS ( Table ), 
CONTAINSSTRING(Table[Note Id], "95") ||
CONTAINSSTRING(Table[Note Id], "GT")
)

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

jonnyA
Responsive Resident
Responsive Resident

@parry2k 

Thank you for your quick response to my issue!

The measure you gave me worked a little bit but my #'s are still off.

The Totals on the left matrix should match the totals on on the right matrix.  The providers circled  are for the same provider.  See how so many more CPT's on the left than the right.  i am not sure why that is?  I appreciate the help in advance!  Thank you 🙂

 

 

jonnyA_0-1611599211704.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.