Forum Discussion

wbhite's avatar
wbhite
Helper I
3 years ago

Issue with ALLSELECTED (or something else?)

Hello all,

Referencing the screenshot provided, I need a measure to show the cumulative total for "Sq Ft * Qty" on all rows.  My current measure simply shows a row-by-row calc, but what I want to see is 31,680 shown on each row (the total of both or however many rows are shown).  Here is my current measure:

 

SqFt x Qty for All Shown = 
        CALCULATE(
            SUM(Products[Sq Ft]) * SUM('PO Data'[Qty]),
            ALLSELECTED(POs)
            )

 

 

Any help is much appreciated.  Please let me know if I'm doing this wrong or not thinking about it the correct way.

Thanks.

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    wbhite Maybe try this:

    SqFt x Qty for All Shown = 
            SUMX(
                ALLSELECTED(POs),
                Products[Sq Ft] * 'PO Data'[Qty]
                )
    • wbhite's avatar
      wbhite
      Helper I

      Sorry, that produces the same results.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi wbhite ,

    Please try:

    SqFt x Qty for All Shown = 
    SUMX(
        SUMMARIZE(
            ALLSELECTED('Products'),
            'Products'[Sq Ft],
            "sum",CALCULATE(SUM('PO Data'[Qty]))
        ),
        'Products'[Sq Ft]*[sum]
    )

    If that doesn't work, consider sharing some sample data or models, note to remove private data.

    How to provide sample data in the Power BI Forum

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

  • wbhite Hello, 

    you have add Podata[qty] in you product data table using related podata[qty]

    you can create a calculated column in dataset for new column = products [Sq.ft] * Podata[qty]


    now you can use calculate(sum[new column],allselected(PO))

     

     

    Thanks 

    Harish M.

     

    Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos