Forum Discussion

Nph's avatar
Nph
Frequent Visitor
1 year ago
Solved

Snapshot data - Generated / Reduced volumes

Hi All, 
Looking for some help with a puzzle I am trying to solve ... 
Please see example data & visual below. 

I have been asked to recreate this visual in Power BI using the example data below.
The generated/reduced volumes are calculated based on the previous month's status (Healthy or SMOG) and change in volume to the next month. 

 

johnt75 

  • Hi Nph ,
    Based on the data 
    You can follow these steps-
    1. Add a measure for Previous Status

    2.Add a measure for Previous Stock

    3.add Change in stock and change in type columns

    4.Calculate Smog Value by Batch, Reduction Value and Generated value.
    5.Plot using clustered column chart with-
    snapshot_date on X-axis

    Smog value by batch, reduction value and Generated value on Y-axis.
    Below snap for reference-

    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

7 Replies

  • Hi Nph ,

     

    Interesting challenge! From what I can see, the key is to calculate the change in volume between months and then classify it as "Generated" or "Reduced" based on the previous month's status.

    Here’s a rough approach you can try in Power BI:

    1. Sort your data by month and use EARLIER() or INDEX() (if using DAX with window functions) to get the previous month's status and volume.
    2. Create a calculated column or measure to compare current and previous volumes.
    3. Based on the logic:
      • If previous month was "Healthy" and volume increased → "Generated"
      • If previous month was "SMOG" and volume decreased → "Reduced"
      • Adjust the logic as needed for your case.

    Once you have that classification, you can use it in a stacked bar chart to show the breakdown.

    If you can share a bit more about the structure of your data (columns, sample rows), I can help write the exact DAX too.

    If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
    translation and formatting supported by AI

    • Nph's avatar
      Nph
      Frequent Visitor

      Hi, thanks for coming back on this. 
      This example is how the data is structured

       

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi Nph ,
    Based on the data 
    You can follow these steps-
    1. Add a measure for Previous Status

    2.Add a measure for Previous Stock

    3.add Change in stock and change in type columns

    4.Calculate Smog Value by Batch, Reduction Value and Generated value.
    5.Plot using clustered column chart with-
    snapshot_date on X-axis

    Smog value by batch, reduction value and Generated value on Y-axis.
    Below snap for reference-

    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi Nph ,
    Just wanted to check if you had the opportunity to review the suggestions provided?
    If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi @Nph ,
    Just wanted to check if you had the opportunity to review the suggestions provided?
    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You

  • v-sdhruv's avatar
    v-sdhruv
    Community Support

    Hi @Nph ,
    Just wanted to check if you had the opportunity to review the suggestions provided?
    If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
    Thank You