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
Anonymous
Not applicable

Unable to COUNTROWS of a virtual table using SUMMARIZECOLUMNS

Hi Community,

I'm getting a strange error in a measure where I want to count the number of rows in a virtual table.
Note that the measure validates successfully.

stevelion_1-1643931779260.png

The virtual table resolves correctly.

stevelion_2-1643932143925.png

What am I missing?

Cheers, Steve

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Unfortunately, the CLACULATE didn't resolve the issue.
Also, the solution below doesn't work as I'm trying to identify the gaps in fact data.
I have resolved the issue by creating the combinations in power query rather than DAX.
Everthing is working well.  Thanks for your responses.
Cheers, Steve

View solution in original post

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

SUMMARIZECOLUMNS does not support calculations that occur during contextual transformations, a feature that prevents it from being used in most metrics. You can use it in metrics that call CALCULATE, but you will get an error if you encounter any contextual conversions.

 

Please refer this article.

https://www.sqlbi.com/articles/introducing-summarizecolumns/ 

 

As @amitchandak said, try addcolumns() and summarize().


Best Regards

Community Support Team _ chenwu zhu

 

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

Anonymous
Not applicable

Unfortunately, the CLACULATE didn't resolve the issue.
Also, the solution below doesn't work as I'm trying to identify the gaps in fact data.
I have resolved the issue by creating the combinations in power query rather than DAX.
Everthing is working well.  Thanks for your responses.
Cheers, Steve

amitchandak
Super User
Super User

@Anonymous , I measure use addolumns and summarize in place of summarize columns

 

example

Countrows( addolumns( summarize(Fact, Fact[Column], dim[Column]), "_1", [Measure]) )

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.

Top Solution Authors