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.
I am new to DAX and need help with an equation that needs to count the number of occurrences when a date field shows "same date".
Date | EmployeID | CategoryID | ||
11/1/2022 | 1 | 1 | ||
11/1/2022 | 2 | 1 | ||
11/1/2022 | 3 | 1 | ||
11/1/2022 | 4 | 2 | ||
11/1/2022 | 5 | 2 | ||
11/1/2022 | 6 | 2 | 0.882353 | |
11/2/2022 | 7 | 1 | ||
11/2/2022 | 8 | 1 | ||
11/2/2022 | 9 | 1 | ||
11/2/2022 | 10 | 1 | ||
11/2/2022 | 11 | 1 | ||
11/2/2022 | 12 | 2 | ||
11/2/2022 | 13 | 2 | ||
11/2/2022 | 14 | 2 | 0.843137 | |
11/3/2022 | 15 | 1 | ||
11/3/2022 | 16 | 1 | ||
11/3/2022 | 17 | 1 | ||
11/3/2022 | 18 | 1 | ||
11/3/2022 | 19 | 2 | ||
11/3/2022 | 20 | 2 | ||
11/3/2022 | 21 | 2 | ||
11/3/2022 | 22 | 2 | 0.862745 |
How do I count the number of Category ID entries within same date range, then create the calc of
(Total # Emps - Category Counts)/total # Emps
Solved! Go to Solution.
Hi , @Tillamook
According to your description, you want to " count the number of Category ID entries within same date range". Right?
But fo the "0.882353,0.843137,0.862745" , i can not kown how to calculate this value.
My test data is the same as yours.
Based on my understand , the "2022/11/1" for the count fo category is 2?
If this , you can click "New Column":
Column = var _rowdate = [Date]
var _t =SELECTCOLUMNS( FILTER('Table','Table'[Date]=_rowdate) , "Category" , [CategoryID])
return
COUNTROWS( DISTINCT(_t))
Then you can get the the number of Category ID entries within same date range.
If this does not meet your needs, can you provide us with your expected output and your detailed calculation logic?
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @Tillamook
According to your description, you want to " count the number of Category ID entries within same date range". Right?
But fo the "0.882353,0.843137,0.862745" , i can not kown how to calculate this value.
My test data is the same as yours.
Based on my understand , the "2022/11/1" for the count fo category is 2?
If this , you can click "New Column":
Column = var _rowdate = [Date]
var _t =SELECTCOLUMNS( FILTER('Table','Table'[Date]=_rowdate) , "Category" , [CategoryID])
return
COUNTROWS( DISTINCT(_t))
Then you can get the the number of Category ID entries within same date range.
If this does not meet your needs, can you provide us with your expected output and your detailed calculation logic?
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
not so sure about the issue and your expected result. this might be helpful:
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 |
---|---|
45 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
70 | |
48 | |
45 | |
19 | |
16 |