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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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