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
057Sophie
Helper II
Helper II

DAX - countrows for a visual with filter on a measure

Hello all

 

I am struggling with some tiny issue I guess.

I have a visual wich is filtered on a measure, the measure is updated/calculated according to what "project" is selected (above right corner)

057Sophie_1-1704708281197.png

 

There I was able to get all the lines related to this project and the first measure works fine, and displays ALL lines related to the item ID from the source table with:

Calculate(COUNT('MBOM Extract Code Matrix'[BOM Line]),ALLEXCEPT('MBOM Extract Code Matrix','MBOM Extract Code Matrix'[Item ID]))
 
Now my struggle is to display the same kind of measure but showing the number of bomlines for eache item id once I have selected the project and where specific line = Yes (column Nb lines for project)
 
For example I would like to see as result 4 for EI-0000019096 and 2 for SI-0000000329,
057Sophie_2-1704708534921.png

 

My goal is to have a check/test lie: if nb selected bomlines fro project = nb of lines in MBOM then TRUE else False or something like this.
But I was trying to decompose this measure in several steps first.
 
Thank you
 
1 ACCEPTED SOLUTION
057Sophie
Helper II
Helper II

I finally mastered it with: 

 

Nb lines for the project =
CALCULATE(COUNTROWS('MBOM Extract Code Matrix'),
FILTER(ALLSELECTED('MBOM Extract Code Matrix'),'MBOM Extract Code Matrix'[Item ID]=SELECTEDVALUE('MBOM Extract Code Matrix'[Item ID])))

View solution in original post

1 REPLY 1
057Sophie
Helper II
Helper II

I finally mastered it with: 

 

Nb lines for the project =
CALCULATE(COUNTROWS('MBOM Extract Code Matrix'),
FILTER(ALLSELECTED('MBOM Extract Code Matrix'),'MBOM Extract Code Matrix'[Item ID]=SELECTEDVALUE('MBOM Extract Code Matrix'[Item ID])))

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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