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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

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

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

 

Anonymous
Not applicable

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

Anonymous
Not applicable

That was it Richard, thanks for the detail!

vikrambasriyar thanks for the solution!

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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