Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have following type of data where for one project, and its one market there may be multiple Parcels Types or a single Parcel Type.
When I plot this data in Power BI visual, I want to retain only those rows where for one project ID and its market there are two Parcel Types (like all rows highlighted in red below)
How can I achieve this? I was hoping to get assistance with a measure that I can add as a filter on the visual.
Solved! Go to Solution.
See this approach by creating the measure and applying filter:
Multiple Rows Project ID =
var _a = CALCULATE( COUNTROWS(), ALLEXCEPT( 'Table', 'Table'[Project ID], 'Table'[Market]))
RETURN IF(_a > 1, 1, BLANK())
Optional: Create another measure to know the count
Count Rows Project ID - Market =
CALCULATE( COUNTROWS(), ALLEXCEPT( 'Table', 'Table'[Project ID], 'Table'[Market]))
Hope it helps!
Hi @Vishruti
Here is another measure / example.
Flag =
MAXX(
ADDCOLUMNS(
SUMMARIZE(
'ProjectsData',
[Project ID],
[Market]
),
"__Cnt", CALCULATE( DISTINCTCOUNT( 'ProjectsData'[Parcel Types] ) )
),
[__Cnt]
) > 1
It will return TRUE for any combinations that have more than 1 Parcel Type. If there is only 1 Parcel Type then it will return FALSE.
Let me know if you have any questions.
See this approach by creating the measure and applying filter:
Multiple Rows Project ID =
var _a = CALCULATE( COUNTROWS(), ALLEXCEPT( 'Table', 'Table'[Project ID], 'Table'[Market]))
RETURN IF(_a > 1, 1, BLANK())
Optional: Create another measure to know the count
Count Rows Project ID - Market =
CALCULATE( COUNTROWS(), ALLEXCEPT( 'Table', 'Table'[Project ID], 'Table'[Market]))
Hope it helps!
Hi, @Vishruti
To filter rows where each Project ID and Market combination has exactly two Parcel Types:
Create a Measure in Power BI: RowsWithTwoParcelTypes =
VAR ParcelTypeCount =
CALCULATE( DISTINCTCOUNT(ProjectsData[Parcel Types]),
ALLEXCEPT(ProjectsData, ProjectsData[Project ID], ProjectsData[Market]))
RETURN
IF(ParcelTypeCount = 2, 1, 0)
Apply as Filter:
Hi @Vishruti
Here is another measure / example.
Flag =
MAXX(
ADDCOLUMNS(
SUMMARIZE(
'ProjectsData',
[Project ID],
[Market]
),
"__Cnt", CALCULATE( DISTINCTCOUNT( 'ProjectsData'[Parcel Types] ) )
),
[__Cnt]
) > 1
It will return TRUE for any combinations that have more than 1 Parcel Type. If there is only 1 Parcel Type then it will return FALSE.
Let me know if you have any questions.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
73 | |
58 | |
36 | |
32 |
User | Count |
---|---|
90 | |
60 | |
60 | |
49 | |
45 |