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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hulabalu
Regular Visitor

Dynamic Calculated Header in Matrix

I have a set of data from 3 tables that I want to group into sections in a Matrix.

 

the source data looks like:

 

Salesman Table

SalesmanAreaStatus
Salesman 1CentralActive
Salesman 2CentralActive
Salesman 3NorthActive
Salesman 4EastActive
Salesman 5WestActive
Salesman 6WestInactive

 

Visit Table

DateWeekSalesmanCustomerPlannedVisited
4 Jan 211Salesman 1Customer 1110
4 Jan 211Salesman 1Customer 1211
4 Jan 211Salesman 1Customer 1311

4 Jan 21

1Salesman 3Customer 3111

5 Jan 21

1Salesman 1Customer 1111

6 Jan 21

1Salesman 4Customer 4111

12 Jan 21

2Salesman 1Customer 1211

12 Jan 21

2Salesman 2Customer 2110

13 Jan 21

2Salesman 5Customer 5111

20 Jan 21

3Salesman 2Customer 2211

27 Jan 21

4Salesman 1Customer 1411

28 Jan 21

4Salesman 5Customer 5211

 

Sales Result Table

DateWeekSalesmanCustomerQuantityModelRevenue
4 Jan 211Salesman 1Customer 121Model 310000
4 Jan 211Salesman 1Customer 121Model S30000
4 Jan 211Salesman 1Customer 131Model 312000

4 Jan 21

1Salesman 3Customer 311Model S28000

5 Jan 21

1Salesman 1Customer 111Model 311000

6 Jan 21

1Salesman 4Customer 411Model X22000

12 Jan 21

2Salesman 1Customer 121Model 310000

13 Jan 21

2Salesman 5Customer 511Model S32000

20 Jan 21

3Salesman 2Customer 221Model 39000

27 Jan 21

4Salesman 1Customer 141Model S30000

28 Jan 21

4Salesman 5Customer 521Model 313000

 

I want to build a Matrix table based on those data, the column headers would be the sum of number of visits a salesman made, the row header would be the sum of quantity of unit he sold, and the value would be the number of salesman.

 

Quantity \ Visit0125Total
01   1
1 3  3
2  1 1
6   11
Total13116

 

The tricky part that I have a problem with is I want to be able to add a slicer to be able to select the week for the report. I tried using calculated column for sum of visits and sum of quantity but the calculation apparently is not affected by the slicer. I have also tried using measure instead for sum of visits and sum of quantity but could not use it as a header for the matrix column and row.

 

Is there any way to build a measure or column based on the name of the Measure?

 

Thanks

 

Tommy

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

2 REPLIES 2
amitchandak
Super User
Super User

@hulabalu , to me this seem like binning or dynamic segmentation on a measure using the independent table.

 

See if these can help

 

https://youtu.be/CuczXPj0N-k

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

Thanks for the response. I used the segmentation using independent table like the one on the video and it worked as  expected. kudos

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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