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.
Hi, am very new to DAX, but trying to learn fast.
I have a situtation where I'm trying to count the number of one item that exists in another column...
basicall my columns look like this
Container Item
Box1 pear
Box1 apple
Box1 peach
Box2 apple
Box2 banana
I'd like to show how many items are in each box in the following format,
Box1 3
Box2 2
seems easy, but I'm struggling to get the formula for some reason.
Solved! Go to Solution.
You do not need any formula as the PowerBI engine automatically counts the no. of products in the Second Column. Drag the column 1 first and then column 2 values to the table visual and right click the Column 2 and select Count.
You can also right click on any column in your table and create measure using the below formula:
CountofProducts:=COUNTA(TableName[ColumnName])
You do not need any formula as the PowerBI engine automatically counts the no. of products in the Second Column. Drag the column 1 first and then column 2 values to the table visual and right click the Column 2 and select Count.
You can also right click on any column in your table and create measure using the below formula:
CountofProducts:=COUNTA(TableName[ColumnName])
thanks, that pointed me in the right direction. With my data I ended up using a counta as you suggested. Initially, I had my fields reversed I believe so was getting inaccurate info.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |