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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jerish
Helper I
Helper I

DAX summarizecolumns throwing an error about context

I am tring to get a daily count for parts like in here

Parts Day Count:=
COUNTROWS( SUMMARIZECOLUMNS(
'Session'[DateKey],'PartsInfo'[SerialNumber]
) )

 

This works fine in the VS Tabular designer(may be as there is no slicer applied). But once deployed into SSAS and used in Excel or PowerBI desktop it thows as error with any slicer. With no slicer it shows a value

 

The error is the following

MdxScript(factTAB) (40, 12) Calculation error in measure 'Session'[Parts Days Count]: SummarizeColumns() and AddMissingItems() may not be used in this context.

 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @jerish 

Do you connect to SSAS Tabular model with Power BI Desktop, then create a measure or calcuated column with your formula?

Are the column added in the slicer in the table "Session" or "PartsInfo" or another table?

what is relationship between "Session" and "PartsInfo"?

could you show an exmaple?

 

Best Regards

Maggie

I have SQL server back-end to which I connect VS Datatools to build the tabular model and then deployed to a SSAS Tabular . I am using PBI desktop to build the report. So in Datatools the measure validated correctly and the aggregation is displayed. Even in PBI desktop it shows the value when there is no filter added. But when I add any filter or even another attribure it throws the error.

 

I simplified the model by mentioning about parts table . Since you are attempting to help I will give the full picture. So the fact table(Session) have daily measures of Machines (EPSInfo) and they are related by column EPSInfoKey.  So, what I am trying to get is a daily number of machines(identified by serialnumber) that have session records.

 

I am using the calculation for the measure  as 

EPS Days Count:= COUNTROWS( SUMMARIZECOLUMNS(
'Session'[DateKey],'EPSInfo'[SerialNumber]
) )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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