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
cjb
New Member

Filtering/counts/if for 0 / Null / and negative value

Really need a helping hand to get an answer in my questions:

 

This is the table, I used a slicer to search their names (dashboard) but what I would like to see are:

 

When I try to search Anna I would like to see the Negative and Zero value under her name. The Anna values below are good but I what I really want to see all the errors under her name. Could that be possible?

Also, what is the formula if would like to count negative value and zero value and above 100 figures?

I tried if statements, counts but I'm getting errors. If DAX is simple as the fx of the excel it could be easier. 

 

NameFigure 1Figure 2Figure 3
Anna-1512000
Fred4500570
Tim465984
Corel10033387
Budd-171001
Anna1005100

 

Hope would hear from you soon. 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @cjb ,

 

To create a measure as below.

 

Measure = 
VAR f1 =
    CALCULATE (
        COUNT ( Table1[Figure 1] ),
        FILTER ( Table1, 'Table1'[Figure 1] <= 0 || 'Table1'[Figure 1] > 100 )
    )
VAR f2 =
    CALCULATE (
        COUNT ( Table1[Figure 2] ),
        FILTER ( Table1, 'Table1'[Figure 2] <= 0 || 'Table1'[Figure 2] > 100 )
    )
VAR f3 =
    CALCULATE (
        COUNT ( Table1[Figure 3] ),
        FILTER ( Table1, 'Table1'[Figure 3] <= 0 || 'Table1'[Figure 3] > 100 )
    )
RETURN
    f1 + f2 + f3

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @cjb ,

 

To create a measure as below.

 

Measure = 
VAR f1 =
    CALCULATE (
        COUNT ( Table1[Figure 1] ),
        FILTER ( Table1, 'Table1'[Figure 1] <= 0 || 'Table1'[Figure 1] > 100 )
    )
VAR f2 =
    CALCULATE (
        COUNT ( Table1[Figure 2] ),
        FILTER ( Table1, 'Table1'[Figure 2] <= 0 || 'Table1'[Figure 2] > 100 )
    )
VAR f3 =
    CALCULATE (
        COUNT ( Table1[Figure 3] ),
        FILTER ( Table1, 'Table1'[Figure 3] <= 0 || 'Table1'[Figure 3] > 100 )
    )
RETURN
    f1 + f2 + f3

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
parry2k
Super User
Super User

@cjb you need to unpivot your table then it will be super easy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

my data is not in a pivot.

 

 

I am thinking about some conditions in DAX or any code to get the specific integer

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.