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
RIDWIV
Helper I
Helper I

Find how many stages were covered by userid with positive value

RIDWIV_0-1684225342716.png

First let me explain you this table. There are total four stages a userid has to go. In red negative value is displayed. All i have to do is to find how many stages userid covered with positive value not negative value.

1 ACCEPTED SOLUTION

Hi @RIDWIV ,

 

Since I'm not quite sure what your criteria for determining the negative value is, I'll use  @FreemanZ 's criteria: the numbers that greater than 0 are postive values.

Here is the example:

vjianbolimsft_1-1685502965765.png

Measure = 
var _a = IF(SELECTEDVALUE('Table'[stage1])>0,1)
var _b = IF(SELECTEDVALUE('Table'[stage2])>0,1)
var _c = IF(SELECTEDVALUE('Table'[stage3])>0,1)
var _d = IF(SELECTEDVALUE('Table'[stage4])>0,1)
return _a+_b+_c+_d

Final output:

vjianbolimsft_0-1685502941349.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

hi @RIDWIV 

supposing your data is like:

IDstage1stage2stage3stage4
100051111
100061-111
10007-1011

try

1) unpivot it to something like:

FreemanZ_0-1684226367552.png

about unpivot: https://learn.microsoft.com/en-us/power-query/unpivot-column

2) plot a table visual with the ID column and a measure like:

 

measure = 
COUNTROWS(
    FILTER(
        data,
        data[Value]>0
    )
)

 

it worked like:

FreemanZ_1-1684226433428.png

 

i tried this but iam getting only single value.

RIDWIV_0-1684241886322.png

 

Hi @RIDWIV ,

 

Since I'm not quite sure what your criteria for determining the negative value is, I'll use  @FreemanZ 's criteria: the numbers that greater than 0 are postive values.

Here is the example:

vjianbolimsft_1-1685502965765.png

Measure = 
var _a = IF(SELECTEDVALUE('Table'[stage1])>0,1)
var _b = IF(SELECTEDVALUE('Table'[stage2])>0,1)
var _c = IF(SELECTEDVALUE('Table'[stage3])>0,1)
var _d = IF(SELECTEDVALUE('Table'[stage4])>0,1)
return _a+_b+_c+_d

Final output:

vjianbolimsft_0-1685502941349.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

i liked your concept but i can't unpivot because max measure is done in dax, any different way to complete this task

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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