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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Count Menu_No by number of appearances on a check (Not by the counts)

in the example below I am trying to total each Menu_No for each CheckID 

I tried the following DAX but I keep getting an error: (expressionrefers to multiple columns and can not be converted to scalar value)

 

CountAppearances = SUMMARIZE(
    POS_CMI,POS_CMI[site_seq],
    POS_CMI[BusinessDate],
    POS_CMI[MENU_NO],
    "Appearances",DISTINCTCOUNT(POS_CMI[Identifier]))

 

 

Bgonen777_2-1708367084085.png

 

Bgonen777_3-1708367776971.png

 

 

 

3 REPLIES 3
v-yohua-msft
Community Support
Community Support

Hi, @Anonymous 

 

When a DAX expression tries to perform an operation that requires a single value, but the expression returns a table of values, you typically see an error message.
Maybe you can try a DAX expression:

CountAppearances = 
SUMMARIZE(
    POS_CMI,
    POS_CMI[site_seq],
    POS_CMI[BusinessDate],
    POS_CMI[MENU_NO],
    "Appearances", CALCULATE(DISTINCTCOUNT(POS_CMI[Identifier]))
)

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

I keep getting the same error: "the expression refers to multiple columns,,multiple columns cannot be converted to a scalar value"

I wish there was a way to add a tiny excel file in here.

This is what I am trying to acheive:

Instead of sum up all the counts (A) 

I am trying to reflect the menu item on the check. 

so if the item reflected 6 times it does not count as 6 but as 1 (if the check itself appear twice it still will count as one time)

I tried to add an identifier  (contain site ID- Tran Date- check ID) and then tried DISTINCTCOUNT of the identifier and it doesn't work.

 

Bgonen777_0-1708638728352.png

 

ryan_mayu
Super User
Super User

could you pls provide the  sample data (not the screenshot)?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.