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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
TamerOmki
Frequent Visitor

Matrix

Hello,

I have raw data as below:
- table 1:

  • user ID
  • month
  • stream code: (1,2,34)

whereas, within this table each user ID might be repeated within the same month based on the stream code he used during the month.

- table 2:

  • Stream code
  • stream name
  • stream name1 (same as stream name)

I'm trying to use a matrix visual with Stream name in the rows and stream name1 in the columns and the value should be distinct count of users who use every two streams.

 

can you please help with the measure?

thank you

6 REPLIES 6
Anonymous
Not applicable

Hi @TamerOmki ,

 

Could you please provide sample data and expected output? That will help us provide you with the right solution.

 

 

Best regards,

Mengmeng Li

rohit1991
Super User
Super User

Hi @TamerOmki ,

You want to count distinct users who used each pair of stream names, using Stream Name (rows) and Stream Name1 (columns).

 

Solution: DAX Measure for Distinct User Count:

UserCount = 
CALCULATE(
    DISTINCTCOUNT('Table1'[User ID]),
    CROSSFILTER('Table1'[Stream Code], 'Table2'[Stream Code], BOTH)
)

Steps to Implement:

  1. Ensure relationships: Table1[Stream Code] → Table2[Stream Code] (Many-to-One).

  2. Create Matrix Visual:

    • Rows: Table2[Stream Name]
    • Columns: Table2[Stream Name1]
    • Values: UserCount (above measure)
 

Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Thank you, I tried this measure but the result was as attached pic

TamerOmki_0-1738744731640.png

 

speedramps
Super User
Super User


Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Thank you

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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