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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Matrix aggregation and filtering

Hi, 

I need to group values in the matrix by Source and Destination columns.  How can I achive this? Thanks for any advice

 

Previous Segment = Source

Currenct Segment = Destination

Expected ResultExpected ResultDestination MeasureDestination MeasureSource MeasureSource Measure

"Calendar table" is not connected with "Table"

Current matrixCurrent matrixInDateRange Measure - filter applied on matrixInDateRange Measure - filter applied on matrix 

 

 

 

10 REPLIES 10
Anonymous
Not applicable

@tamerj1 

thanks, this works but the problem is when I remove person_id from the table this happens ( it is grouping all the fields in the table) and I want to achive this on first screentshot in the first post

palmal2_0-1663247040717.png

 

@Anonymous 

In the first screenshot, does each row represents on Id?

Anonymous
Not applicable

@tamerj1 No, this is grouped by source and destination and  Total Users = count(persona_id)

 

this is not easy to implement because slicer can't affect on calculated table so I've created this two measures - source and destination. I am not sure how to show only these two measures on matrix/table

@Anonymous 
Technically it is not possible as power bi does not support slicing by or grouping by measures. There must be a column. Actually it's not clear to me what does it mean to group by a measure if it has any meaning.

Anonymous
Not applicable

yes, ok I should explain it better . I am not sure if this is technically achivable but according to date range on slicer I want to take first (soruce) and last (destination) segment_name for each persona_identifier and then group this by source and destination with count on persona_identifier

 

palmal2_0-1663250358100.png

 

@Anonymous 
I can think of two possibilities. We have a good chance to do that by concatenation and a smaller chance by filter measure. Please share a sample data to work with and let me see if I can produce somthing.

Thank you

Anonymous
Not applicable

Hi @tamerj1  

sorry for late reply. here is a sample dataset

@Anonymous 

I don't see any link?

Anonymous
Not applicable

tamerj1
Super User
Super User

@Anonymous 

Please try

Source =
VAR SelectedDate =
MIN ( 'Calendar'[Date] )
VAR CurrentIDTable =
FILTER ( 'Table', 'Table'[segment date] > SelectedDate )
VAR FirstRecord =
TOPN ( 1, CurrentIDTable, 'Table'[segment date], ASC )
RETURN
MAXX ( FirstRecord, 'Table'[segment_name] )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.