cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Fsciencetech
Helper III
Helper III

Dax Query

Hi folks,

 

I have an dax code which is running will in dax editor, the same thing I want to run on my PBI but throwing error

"Calculation error in measure 'Sales[Max GA%]: SummarizeColumns() and AddMissingItems() may not be used in this context"

Dax Editor :

 

DEFINE
VAR FinalTable = 
    SUMMARIZECOLUMNS(Sales[YearQtr], Sales[BrandCode Group]
        FILTER(KEEPFILTERS(VALUES('Sales'[BrandCode Group])), 'Sales'[BrandCode Group] <> "PCSD")
        "GA_Mix_", 'Sales'[GA Mix%])      ---- Using Measure pre calculated Mix%

  VAR TopBrandValue = 
       TOPN(1, FinalTable, [GA_Mix_], 0)

 

  VAR Result = 
    SUMMARIZECOLUMNS(
      Sales[BrandCode Group], Sales[YearQtr],    
      TopBrandValue,
      "GA_Mix_", 'Sales'[GA Mix%]
    )
EVALUATE
  GROUPBY(Result, "MinGA_Mix_", MINX(CURRENTGROUP(), [GA_Mix_]))

I want to same dax on PBI.

1 REPLY 1
amitchandak
Super User
Super User

@Fsciencetech , Try if you can do same with Addcolumns(Summarize in place of summarize columns  

 

Refer for example 

Solved: Issue with Bar chart: SummarizeColumns() and AddMi... - Microsoft Power BI Community

 

also refer

Power Pivot Principles: The A to Z of DAX Functions - ADDMISSINGITEMS < Article < Blog | SumProduct ...



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors