March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there,
I have a column called "Error Number" in a table called "Errors" and I have a column in my data table called "values". I'd like to count the amount of times a value in my "values" column matches up with an error number from my column " Error Number", i.e. how many instances error number 104 appears in the "values" column and so on for each error number listed.
I've tried using countax but it returns the same value in each row instead of what is shown in the table below. The dax code i used was: Count = COUNTAX(FILTER('Data', Data[Attribute] = "Error Number []"), 'Data'[Value] = ('Errors'[Error Number]))
Error Number | Count |
104 | 1 |
204 | 0 |
205 | 0 |
404 | 0 |
405 | 0 |
502 | 30 |
503 | 2 |
802 | 50 |
803 | 200 |
1304 | 0 |
1417 | 0 |
3403 | 0 |
3501 | 15 |
3502 | 300 |
3511 | 47 |
3517 | 2 |
3519 | 5 |
3521 | 0 |
3522 | 0 |
3601 | 22 |
3803 | 35 |
4003 | 53 |
6002 | 0 |
6013 | 103 |
@Jonathan47 , This will give the same value
COUNTAX(FILTER('Data', Data[Attribute] = "Error Number []"), 'Data'[Value] = ('Errors'[Error Number]))
Unless you add something like in the filter
Data[Attribute] = earlier(Data[Attribute] )
Hi @amitchandak, I'm not too sure how this would solve my problem. I need to first filter my values column using my attributes column since there are multiple attributes in my values column. Changing the code to COUNTAX(FILTER('Data', earlier(Data[Attribute]) = "Error Number []"), 'Data'[Value] = ('Errors'[Error Number])) gives me an error (I guess I've put it in the wrong place)
https://drive.google.com/drive/u/0/folders/1M2HlRKgtvPcsyK-VWwYmkWu5ZHCYRuHN
Here is a link to a sample data set I created. Theres no need to filter attributes in this example. I just need to count the values column for each error number (evaluated for each row). If you/someone could give me an example of how I can do this that would be very helpful. TIA
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |