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

How to identify a new job in Power BI (with starting value 0)

Hi,

 

I have a task in my monthly report. I need to identify new jobs in the forecast sheet. 

 

Our forecast sheet looks like this:

 

CustomerProject1-Nov-191-Dec-191-Jan-201-Feb-201-Mar-201-Apr-20
Customer 1Project 1001001001000
Customer 1Project 210010010010000
Customer 1Project 3100100100200200300
Customer 2Project 4300400100100100100
Customer 2Project 50100200000
Customer 3Project 600015000
Customer 4Project 7000000



I need a measure to identify new jobs. In the table above, Customer 1 has a new Project 1, Customer 2 has a new Project 5, and Customer 3 has a new Project 6. Because their volume is 0 in the starting month/months. It doesn't matter how many months a customer has 0 volume. As long as it has 0 in the beginning month/months, we treat it as a new job. However, if a customer has 0 in all months, it's not a new job, i.e., Customer 4's Project 7 is not a new job.

 

I'm also struggling of where to place this result (Y/N of new job) in the table. I can put Project number as a drilldown under Customer in the Rows. And the month is placed in the Columns. 

 

Have been struggling on this issue for a while. Anybody?

 

Thank you in advance!!!!

 

Regards, 

 

 

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

Hi @ymobbs ,

 

You could unpivot your date columns and create a new date column.

Then you could create two measures to get "Y/N" and use matrix visual to show the result.

Measure =
VAR a =
    CALCULATE (
        MIN ( 'Table'[Attribute] ),
        ALLEXCEPT ( 'Table', 'Table'[Project] )
    )
VAR c =
    CALCULATE (
        SELECTEDVALUE ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Attribute] = a )
    )
VAR b =
    CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Project] ) )
RETURN
    IF ( c = 0 && b <> 0, "Y", "N" )
Value measure =
IF (
    NOT ( ISINSCOPE ( 'Table'[Attribute] ) ),
    [Measure],
    SELECTEDVALUE ( 'Table'[Value] )
)

Here is the result.
1-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @ymobbs ,

 

You could unpivot your date columns and create a new date column.

Then you could create two measures to get "Y/N" and use matrix visual to show the result.

Measure =
VAR a =
    CALCULATE (
        MIN ( 'Table'[Attribute] ),
        ALLEXCEPT ( 'Table', 'Table'[Project] )
    )
VAR c =
    CALCULATE (
        SELECTEDVALUE ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Attribute] = a )
    )
VAR b =
    CALCULATE ( SUM ( 'Table'[Value] ), ALLEXCEPT ( 'Table', 'Table'[Project] ) )
RETURN
    IF ( c = 0 && b <> 0, "Y", "N" )
Value measure =
IF (
    NOT ( ISINSCOPE ( 'Table'[Attribute] ) ),
    [Measure],
    SELECTEDVALUE ( 'Table'[Value] )
)

Here is the result.
1-1.PNG

Here is my test file for your reference.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Thank you very much! It works!

@v-eachen-msft 

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.