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

SUM Revenue , distinct by Job NO

Dear Team

 

 

 

Need your Help

I have table of Revenue, what i want is Getting Total or SUM

but my problem is there are some detail which is similiar or duplicate due user double copy paste it .

how to calculate my revenue with distinct JOB NO.

Pls See my table below

Rev.png

right calculation is green Revenue

pls helpp in DAX or other way

 

Thanks

Syaiful

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

Hi,

 

Please take following steps:

1)Add an index column in Query Editor.

2)Try this measure:

 

New Revenue = 
SUMX (
    GROUPBY ( 'Table', 'Table'[Index], 'Table'[No Job] ),
    CALCULATE (
        IF (
            CALCULATE (
                MIN ( 'Table'[Index] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[No Job] IN FILTERS ( 'Table'[No Job] )
                )
            )
                <> MAX ( 'Table'[Index] ),
            BLANK (),
            MAX ( 'Table'[Revenue] )
        )
    )
)

 

3)The result shows:

1.PNG

Here is my tets pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

View solution in original post

8 REPLIES 8
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please take following steps:

1)Add an index column in Query Editor.

2)Try this measure:

 

New Revenue = 
SUMX (
    GROUPBY ( 'Table', 'Table'[Index], 'Table'[No Job] ),
    CALCULATE (
        IF (
            CALCULATE (
                MIN ( 'Table'[Index] ),
                FILTER (
                    ALLSELECTED ( 'Table' ),
                    'Table'[No Job] IN FILTERS ( 'Table'[No Job] )
                )
            )
                <> MAX ( 'Table'[Index] ),
            BLANK (),
            MAX ( 'Table'[Revenue] )
        )
    )
)

 

3)The result shows:

1.PNG

Here is my tets pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

Pragati11
Super User
Super User

Hi @Anonymous ,

 

You can try creating a measure as follows:

 

Revenue_Sum = CALCULATE(

                                              SUM('Revenue'[Revenue]),

                                              FILTER(DISTINCT('Revenue'), 'Revenue'[No Job] = MAX('Revenue'[No Job])

                                                         )

                                              )

 

Test the above DAX if this works for you or not.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Thanks for ur Respond

But i still dont get it

 

would u share me on pbix file

 

Hi @Anonymous ,

 

Can you please try tagging the person in your comment? It's hard to judge who you are refrerring to in your comment.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Hi,

 

I have attached my test pbix file in my previous reply.

See this:

https://microsoftapc-my.sharepoint.com/:u:/g/personal/v-gizhi_microsoft_com/EZasVZz5XkxMmfrDKFG145gB... 

 

Best Regards,

Giotto

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can cleanse your data in Power Query by applying  group by No Booking, No Job and Max of Revenue

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Dax pls

Im new in DAX

Hi @Anonymous ,

 

Check the following link to start with how to create a measure and use th measure calculation I posted in my last reply.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.