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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
HPS1RT
Frequent Visitor

Power BI measure

Hello Everyone,

I am newbie to Power BI. I have a table with SREQ ID and Project ID. Please refer the below Image.

HPS1RT_0-1712158392398.png

When I apply the filter on Project ID that contains "E" or "G", it should give me the total count of SREQ IDs. Please refer below Image:

HPS1RT_1-1712158728101.png

Now I just wanted to create dax measure, so that it gives count of SREQ ID's as 3 in this case. Please note that I wanted to apply the filter on the visual, don't want to define it inside dax.

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @HPS1RT ,

 

I think there is a misconception that measure is based on context. It's true that you are using selectedvalue for filtering in your measure, but it's used for slicer. You can try copy table and then implement it without DAX:

vtianyichmsft_0-1712211418374.png

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

5 REPLIES 5
Anonymous
Not applicable

Hi @HPS1RT ,

 

I don't fully understand what you mean, is it the following result?

vtianyichmsft_0-1712197309255.png

 

Please feel free to correct me and provide more information if I have misunderstood you!

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

Hello @Anonymous @lbendlin ,

Thank you for your answer. Here is my measure:

Measure = CALCULATE(DISTINCTCOUNT('Table'[SREQ ID]), CONTAINSSTRING( 'Table'[Project ID], SELECTEDVALUE('Table'[Project ID])))

HPS1RT_0-1712210012440.png

I need to get the count of 3, if select the filter that contains E or G. But it is giving me 5. Can you please help me to correct this measure?
Thanks in advance:)

Anonymous
Not applicable

Hi @HPS1RT ,

 

I think there is a misconception that measure is based on context. It's true that you are using selectedvalue for filtering in your measure, but it's used for slicer. You can try copy table and then implement it without DAX:

vtianyichmsft_0-1712211418374.png

 

An attachment for your reference. Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you @Anonymous 
That worked:)

lbendlin
Super User
Super User

Please note that I wanted to apply the filter on the visual, don't want to define it inside dax.

Visual Calculations use DAX too (plus some extra functions).

 

Consider using SEARCH in your visual calculation formula.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.