Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Summing a DAX/quick measure with column values, possible ?

Hello Community,

 

We have a table with:
Month      Qty
202001     1

202002     2

202003     3

 

In that table, we have created a quick measure that is a DAX formula. This DAX formula sums Qty before 2020 and returns one value.
Now, suppose the result of the DAX formula is 4.  I want to have a new column "Final Qty" whose value is 4 + 1 = 5 for 202001, 4 + 2 for 202002 and 4 + 3 = 7 for 202003.

 

Table would eventually looks like:

Month     Qty     DAX     Final Qty

202001    1         4          5

202002    2         4          6

202003    3         4          7

 

(   not much DAX / PBI experience I must say ðŸ™„ but been lurking around  )

 

Thx for shedding some lights, for the sake of my hairs 😉

 

Brgds,

Olivier

8 Replies

  • Anonymous 

    Not sure how your measures are built, but you can dimple added two measures:

    Final Qty = [DAX] + sum(Table[Qty])

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn

    • Anonymous's avatar
      Anonymous
      Not applicable

      When using my DAX measure in formula, it's always empty. And when diplaying it in a Card visualization, I can see its value though.

  • Anonymous , if you have created a measure then you need to create a mesure. You can not use measure in a new column

     

    1. You create a measure

    measure =
    var _1 = [Qty before 2020]
    return
    sum(Table[Qty]) +1

     

    2. You create a column

    new column =
    var _1 = [Qty before 2020]
    return
    (Table[Qty]) +1

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    I assume that by "table" you mean a table visual. If so, 

    1. Place Month in the visual, as you already had

    2. Create a explicit measure for the Qty and place it in the visual:

     

    QtyMeasure =  SUM(Table1[Qty])

     

    3. Place your DAX measure in the visual, as you already had

    4. Create this measure (simply the sum of the two previous ones) and place it in the visual:

     

    Final Qty = [QtyMeasure] + [Your DAX Measure]

     

    Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

    Contact me privately for support with any larger-scale BI needs, tutoring, etc.

    Cheers 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      When used in formula, my DAX measure is = 0/blank/empty 😞

      • Payeras_BI's avatar
        Payeras_BI
        Icon for Solution Sage rankSolution Sage

        Hi Anonymous ,

         

        Your measure [Opened Before Reporting period] is taking into account the filter context created in your Table visualization by placing the YYYYMM in the rows.

         

        Regards,

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Table is not a table visual, it's a table available as follow in the Data Table Tool:

     

    The table visual in Reportin tool:

    Table visual in Report tool

     

    On left, a Card visualization showing Qty "before" = 3.

    On right, the table visual where I would like to add "3" to all Running Total value.
    So 2019 10 = 4 (1+3), 2019 11 = 4 (1+3), 2019 12 = 2 (-1+3), 2020 01 = 3 (0+3), and so on...

    • wdx223_Daniel's avatar
      wdx223_Daniel
      Icon for Community Champion rankCommunity Champion

      FinalTotal=CALCULATE([Opend Before Reorting Period],ALLSELECT())+[Running Total]