Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Multiple different aggregations within the same column

Hi all,

 

I believe I have a unique challege on how to show something:

  • Measure slicer:
    • Measure A (SUM)
    • Measure B (SUM)
    • Measure C (SUM)
    • Measure D (DIVIDE)
  • Unit of Measure slicer:
    • Dollars
    • Euros
    • Local Currency

And as an example, each measure (A, B, C, D) can have their corresponding units of measure. For example, measure A can be in Dollars, Euros and Local Currency, measure B, C, D as well (basically a cartisian join).

 

This is how the data looks like in fact table:

week_idmeasure_namemeasure_value
1measure A in Dollars9
1measure A in Euros32
1measure A in Local Currency93
1measure B in Dollars12
1measure B in Euros61
1measure B in Local Currency45
2measure A in Dollars26
2measure A in Euros72
2measure A in Local Currency19
2measure B in Dollars73
2measure B in Euros65
2measure B in Local Currency7

 

Dimensional tables are connected (one - to - many) to fact table like shown here (sorry for blacking out the data 🙂 😞

 

Visualtion has to look like following:

 

Now, I have following question:

  1. How do I make a SINGLE measure that will either DIVIDE or SUM
    1. for example, if Measure A is selected, measure should SUM, and if Measure A and measure D is selected, measure should SUM and DIVIDE

 

Hopefully, I have explained it clearly enough. 🙂

 

Thank you all!

1 Reply

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi Anonymous 

    Sum what and divide what? Please give a caculation example.