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
garridog
New Member

Filter with two different measures

Hi, hope you can help me out.

I have 2 different measures, one that counts the rows from a table containing light objects, and another one that counts in a different table the heavy ones; so I want to show a visual card with the count of the light, heavy or the sum of both, depending on what's selected on the filter that comes from another table, this table has merged the light and the heavy ones with a column that indicates the type "light" or "heavy" and this is the one I want to use to use as a filter.

 

so far this are the measures I have and I have them in the table with the mixed data.

 

Light = CALCULATE(COUNTROWS(V_Light), FILTER(MixedData, MixedData[Type]))

Heavy = CALCULATE(COUNTROWS(V_heavy), FILTER(MixedData, MixedData[Type]))

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @garridog ,

 

Here we can create a measure as below.

Measure = var _sele = SELECTEDVALUE('Table'[Type])
var light = COUNTROWS(V_Light)
var heavy = COUNTROWS(V_heavy)
return
IF(_sele = "light",light,IF(_sele= "heavy",heavy,light+heavy))

Then we can get the result based on the value in slicer.

Capture.PNG

For more details, please check the pbix as attached.


Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @garridog ,

 

Here we can create a measure as below.

Measure = var _sele = SELECTEDVALUE('Table'[Type])
var light = COUNTROWS(V_Light)
var heavy = COUNTROWS(V_heavy)
return
IF(_sele = "light",light,IF(_sele= "heavy",heavy,light+heavy))

Then we can get the result based on the value in slicer.

Capture.PNG

For more details, please check the pbix as attached.


Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi @v-frfei-msft , thanks for your reply it worked like a charm.

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.

Top Solution Authors