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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
TamerOmki
Frequent Visitor

intersecting streams matrix

Hello dears,

 

within my report, I have 4 revenue streams where every user might use multiple streams during the month.

 

I'm studying the count of users who use each pair of streams.

 

within the below link, I added a sample of the raw data in addition to the expected outcome.

 

https://docs.google.com/spreadsheets/d/1sqeFj_VjTEtFli9hranSLtn9c0CQ2HeE-3QoURlu_UU/edit?usp=sharing

 

would you please help with the measure?

Thanks.

1 ACCEPTED SOLUTION
quantumudit
Super User
Super User

Hello @TamerOmki 

Thank you for providing the sample data and desired outcome. I made a slight modification to the "Raw Data 2" table. Instead of having both Stream and Stream1 columns in the same table, we need to create a single table with two columns: "Stream Code" "Stream," and duplicate this table.

 

Here are the tables I have taken. Please note that the tables are disconnected, and the "StreamRows" and "StreamCols" tables are, containing only the two columns mentioned above.

quantumudit_0-1738870341362.png

Now, we can create the following measure to get the desired result. Here is the DAX

Unique Users = 
VAR _stCode1 =
    CALCULATE (
        VALUES ( StreamRows[Stream Code] ),
        StreamRows[Stream] = SELECTEDVALUE ( StreamRows[Stream] )
    )
VAR _stCode2 =
    CALCULATE (
        VALUES ( StreamCols[Stream Code] ),
        StreamCols[Stream] = SELECTEDVALUE ( StreamCols[Stream] )
    )
VAR _userCount1 =
    SELECTCOLUMNS ( FILTER ( Users, Users[Strem code] = _stCode1 ), Users[User] )
VAR _userCount2 =
    SELECTCOLUMNS ( FILTER ( Users, Users[Strem code] = _stCode2 ), Users[User] )
VAR _userCount =
    COUNTROWS ( INTERSECT ( _userCount1, _userCount2 ) )
RETURN
    _userCount

Here is the screenshot of the results:

quantumudit_1-1738870639496.png

I am also attaching the Power BI file for your reference.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

Proud to be SuperUser

View solution in original post

2 REPLIES 2
TamerOmki
Frequent Visitor

thanks a lot

quantumudit
Super User
Super User

Hello @TamerOmki 

Thank you for providing the sample data and desired outcome. I made a slight modification to the "Raw Data 2" table. Instead of having both Stream and Stream1 columns in the same table, we need to create a single table with two columns: "Stream Code" "Stream," and duplicate this table.

 

Here are the tables I have taken. Please note that the tables are disconnected, and the "StreamRows" and "StreamCols" tables are, containing only the two columns mentioned above.

quantumudit_0-1738870341362.png

Now, we can create the following measure to get the desired result. Here is the DAX

Unique Users = 
VAR _stCode1 =
    CALCULATE (
        VALUES ( StreamRows[Stream Code] ),
        StreamRows[Stream] = SELECTEDVALUE ( StreamRows[Stream] )
    )
VAR _stCode2 =
    CALCULATE (
        VALUES ( StreamCols[Stream Code] ),
        StreamCols[Stream] = SELECTEDVALUE ( StreamCols[Stream] )
    )
VAR _userCount1 =
    SELECTCOLUMNS ( FILTER ( Users, Users[Strem code] = _stCode1 ), Users[User] )
VAR _userCount2 =
    SELECTCOLUMNS ( FILTER ( Users, Users[Strem code] = _stCode2 ), Users[User] )
VAR _userCount =
    COUNTROWS ( INTERSECT ( _userCount1, _userCount2 ) )
RETURN
    _userCount

Here is the screenshot of the results:

quantumudit_1-1738870639496.png

I am also attaching the Power BI file for your reference.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

Proud to be SuperUser

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.