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
filipebodas
Helper I
Helper I

Count repeated shippment methods

Morning,

 

I have 3 columns as following in the table below:

 

DateIDMethod
01/01/20211A
01/01/20212A
02/02/20211A
02/02/20212B
10/04/20211C
11/04/20213C
06/06/20212B
07/06/2021B
09/08/20211A
09/08/20212A
09/08/20213A
15/09/20213B

 

I would to calculate how many ID came back using the same Method.

 

In this example, the output should be a visualization as seen in the table below:

 

MethodCount
A2
B1
C0

 

The last line can be left out.

Should I use a variable to build a calculatetable and the countrows? I'm having trouble summarizing the data and the acess the table as a variable.

Thanks

1 ACCEPTED SOLUTION

REQMeasure = 
VAR __vix=FILTER(
           SUMMARIZE(Tablex,Tablex[ID],Tablex[Method],"@cnt",COUNT(Tablex[ID])),[@cnt]>1)
RETURN
COUNTROWS(__vix)

View solution in original post

7 REPLIES 7

REQMeasure = 
VAR __vix=FILTER(
           SUMMARIZE(Tablex,Tablex[ID],Tablex[Method],"@cnt",COUNT(Tablex[ID])),[@cnt]>1)
RETURN
COUNTROWS(__vix)

vikrambasriyar thanks for the reply! This solution you provide returns an error: "The syntax for 'Table' is incorrect. (DAX(VAR __vix = FILTER ( SUMMARIZE ( Table, Table[ID], Table[Method], "@cnt", COUNT(Table[ID]) ), [@cnt] > 1)RETURNCOUNTROWS(__vix)))."

Use as a measure and replace the table name in the DAX.

vikrambasriyar_0-1644409844682.png

 

filipebodas_0-1644410203028.png


It stills gives me an error..

I had some info to the original post

Try removing the '' marks

Hello

 

Try putting ' ' marks around all your references to Table.  DAX thinks you are calling the function TABLE()

 

Regards

Richard

That was it Richard, thanks for the detail!

vikrambasriyar thanks for the solution!

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.