Forum Discussion

mtussey's avatar
mtussey
New Member
1 year ago
Solved

Column Total with All Other not equal.

Hello All,

Please see I set a calculation to calculate the Top 8, but the one total isn't adding the "all other" (144K).

 

Here is my measure via help on YouTube:

Top Category Units =

VAR TopProdTable =
TOPN(8, ALLSELECTED('Pseudo Supplier'),[CY Units]
    )
 VAR TopProdSales =  CALCULATE(
    [CY Units],
    KEEPFILTERS( TopProdTable)
       
)
VAR AllOtherSales =
    CALCULATE([CY Units],
    ALLSELECTED('Pseudo Supplier')
    ) - CALCULATE([CY Units],TopProdTable
    )
VAR CurrentProd = SELECTEDVALUE('Pseudo Supplier'[PrimarySupplier])
Return
    if(CurrentProd<> "All Other",
        TopProdSales,
        AllOtherSales)
 
Any ideas how to get the total on Top products and the all other to equal the 3.08M?

TIA.
 

7 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

  • Hi mtussey 


    At the total level, CurrentProd evaluates to true because SELECTEDVALUE('Pseudo Supplier'[PrimarySupplier]) returns blank. As a result, only TopProdSales is returned. There's nothing in the logic that adds AllOtherSales back in. Try

    IF (
        NOT ( HASONEVALUE ( 'Pseudo Supplier'[PrimarySupplier] ) ),
        [CY Units]  -- or TopProdSales + AllOtherSales,
        IF (
            CurrentProd <> "All Other",
            TopProdSales,
            AllOtherSales
        )
    )
    

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mtussey,

    Thanks for reaching out to the Microsoft fabric community forum.

    Just following up to your previous conversation with Ashish_Mathur, danextian and lbendlin, I'd like to confirm if you've successfully resolved this issue or if you need further help.

    If you have got the solution then kindly share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.

     

    I would also take a moment to thank Ashish_Mathur, danextian and lbendlin, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

    Best Regards,
    Hammad.
    Community Support Team

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi mtussey,

      As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.

      If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution. And if you're still looking for guidance, feel free to give us an update, we’re here for you.

       

      Best Regards,

      Hammad.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi mtussey,
        Hope everything’s going smoothly on your end. As we haven’t heard back from you, so I wanted to check if the issue got sorted.
        Still stuck? No worries just drop us a message and we can jump back in on the issue.

         

        Best Regards,

        Hammad.