Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
jasemilly
Helper II
Helper II

create measure that returns best customer between months use in a textbox

Hi Everyone

I trying to show which customer has improved the most, compared to the previous month. 

 

I would use, the smart narrative visual to acheive this but I am using Zebra BI custom visuals as the main visual, Power bi informs these two items don't work together.

So, I would like to create a measure ,that I can use in the Text box.  Displaying something like "This month Customer, "   X "has changed the most compared to last month"

 

X been the result of the measure


I already have a measure that calculates the variance between the 2 months.  

I placed a card on the report, then put the customer name in the field well and applied the filter topN  = 1  on the variance measure all works great.

I then used the performance analyzer to capture the generated Dax.  

 

Total mom Overhead Top Change = 
  
  VAR __DS0FilterTable = 
    TREATAS({2021}, 'Periods'[Year])

  VAR __DS0FilterTable2 = 
    TREATAS({"January"}, 'Periods'[Month Name])

  VAR __SQDS0Core = 
    SUMMARIZECOLUMNS(
      'DimNLNominalAccount'[AccountName],
      __DS0FilterTable,
      __DS0FilterTable2,
      "Total_MoM__ABS_Overheads", 'A_Measure'[Total MoM  ABS Overheads]
    )

  VAR __SQDS0BodyLimited = 
    TOPN(1, __SQDS0Core, [Total_MoM__ABS_Overheads], 0)

Return
  SUMMARIZECOLUMNS(
    __DS0FilterTable,
    __DS0FilterTable2,
    __SQDS0BodyLimited,
    "MinAccountName", IGNORE(CALCULATE(MIN('DimNLNominalAccount'[AccountName])))
  )

 

Now when I try to use the measue for the card I get the following error,

 

SummarizeColumns() and AddMissingItems() may not be used in this contet.

 

This is the same dax that works fine on the original card, where I manually set it up.


Thanks to everyone in advance for help and suggestions.

1 REPLY 1
lbendlin
Super User
Super User

Use SUMMARIZE() insted.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors