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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

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 @Anonymous ,

 

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 @Anonymous ,

 

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.
Anonymous
Not applicable

Thank you very much! It works!

@v-eachen-msft 

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors