Skip to Content

WEBI summing distinct values

Dear all

Let us say I have a table as the below :

In my case if the project_id is the same , the last_total cost will always be the same. If I remove the Reference, the Last total cost will be aggregated as below :

However I wish to SUM all last total cost ONLY for distinct Project_id so in this example I would want the result to be

100 96.65

I have tried a combination of using IN clause but I can't seem to get it right. On Microsoft BI I had to create two variables but in the end I got what I wanted. Can someone pls help a newbie WEBI user pls ?

Last total cost is a measure.

Tnx

konrad

krs1o.png (12.9 kB)
obq2g.png (10.1 kB)
l6qb9.png (5.2 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Feb 27, 2019 at 04:31 PM

    Hi Konrad,

    Create a variable with [Last Ttl Cost] =If(Count([Reference]) In([Project Id]) >1) Then ([Last Total Cost]/Count([Reference])) Else [Last Total Cost]

    Kind regards,

    Tom


    766242.png (7.3 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2019 at 08:13 PM

    other way to achieve this is:

    create dimension variable on Last Total Cost object as " V Last Total Cost".

    Final variable=max([V Last Total Cost]) in ([Project Id])

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 01, 2019 at 03:19 PM

    Dear all,

    Thanks for your answers.

    They both work.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.