Get value for first day of the month

Options
jimsteph
jimsteph Contributor

I need to be able to create a beast mode that does the following: for any given month sum up columns A, B, and C, then get the value D for the first day of the month, and implement the following formula:

(SUM(A) + SUM(B) - SUM(C) / D for the first day of the month

I can do it in an ETL, but that involves aggregations and the Powers That Be want to be able to drill down to the underlying values. Is it possible to get value D in a Beast Mode?

Best Answers

  • Jones01
    Jones01 Contributor
    Answer ✓
    Options

    @jimsteph

    something like this may work

    SUM(A) + SUM(B) - SUM(C) / sum(case when DAYOFMONTH('DateCol') = 1 then D else 0 end)

  • ColemenWilson
    Answer ✓
    Options

    I would use a dataflow but keep the data granular so drill downs are possible. I would just add a formula tile that for every row in the dataset gets the value from the first day of the month. Then the beastmode or calculated field in the ETL is really clean.

    A + B + C / D

    This would be the data structure and what they would see when drilling down ^

    If I solved your problem, please select "yes" above

Answers

  • Jones01
    Jones01 Contributor
    Answer ✓
    Options

    @jimsteph

    something like this may work

    SUM(A) + SUM(B) - SUM(C) / sum(case when DAYOFMONTH('DateCol') = 1 then D else 0 end)

  • ColemenWilson
    Answer ✓
    Options

    I would use a dataflow but keep the data granular so drill downs are possible. I would just add a formula tile that for every row in the dataset gets the value from the first day of the month. Then the beastmode or calculated field in the ETL is really clean.

    A + B + C / D

    This would be the data structure and what they would see when drilling down ^

    If I solved your problem, please select "yes" above

  • jimsteph
    jimsteph Contributor
    Options

    Thank you both. @colemenwilson , I think yours was about the same, but I was able to implement @Jones01's immediately.