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

Row sum in matrix with boolean value

 
5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Sorry, your model calculation will be very complicated, and you may need to make auxiliary tables. Your mode is SSAS, right? You cannot create auxiliary columns?

 

Best Regards,
Community Support Team_ Yalan Wu

v-yalanwu-msft
Community Support
Community Support

Hi. @Anonymous ;

I'm very sorry, I can't reproduce your model, and can't judge the reason. Can you share the file and hope the output result after removing sensitive information?

 

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

According to the official documentThis function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules. 

There is no mention of the restrictions in SSAS, maybe because of the version, you can try to update the version of the desktop. In addition, I tested it with SSAS and it was ok.

vyalanwumsft_0-1639381765385.png

 

Secondly, you can also use HASONEVALUE or ISFILTERED functions to replace ISINSCOPE function , Another point is to create measure instead of column.

Or can you share me Screenshot of the error message.


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create two measures about it:

count = IF(SUM([value])>0,1,0)
measure =
IF (
    ISINSCOPE ( 'Table'[name] ),
    SUMX ( FILTER (ALL ( 'Table' ),
            [name] = MAX ( 'Table'[name] )
                && DATEDIFF ( [Date], MAX ( 'Table'[Date] ), WEEK ) IN { 0, 1, 2, 3 }),
        [count]),
    SUMX (FILTER (ALL ( 'Table' ),
            DATEDIFF ( [Date], MAX ( 'Table'[Date] ), WEEK ) IN { 0, 1, 2, 3 }),
        [count] ))

The final output is shown below:

vyalanwumsft_0-1639378574861.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a measure by ISINSCOPE() AND HASONEVALUE().

Measure = IF(HASONEVALUE('Table'[Date])&&ISINSCOPE('Table'[name]), IF(SUM([value])>0,1,0),SUM('Table'[value]))

The final output is shown below:

vyalanwumsft_0-1639365174242.png

If this formula does not apply to your data, can you share a simple example similar to your original table structure and the result you want to output?

Looking forward to your reply!


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.