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.
Hey Folks,
I have a problem with a data table and cant figure out the problem. It would help me a lot if you have an idea on this issue.
There is a data table like this
Name | date | value |
a | 2023-10-20 | 1 |
b | 2023-10-20 | 1 |
a | 2023-10-21 | 1 |
a | 2023-10-22 | 1 |
a | 2023-10-22 | 1 |
he value in the value Column is always 1, the values in the other rows can be different.
In this example the result for "a" = 4, "b" = 1
For my Visualition I need a table which looks like this:
Category | Sum |
1-3 days | 1 |
4-10 day | 1 |
I ve managed to create a measure which shows me the category text ("1-3 days", "4-10 days") if I combine it with the "Name" column. But I cant summarize just the Category column.
Is there any way to solve this?
Greetings
Rico
"Category" is not a colomn in the data table. "Category" is the value which is Calculated from the measure. So I guess this wont work.
This is the DAX of the measure:
I need this for an absence overview. I want to know how many absence days have been totally spent in the 1-3 days range, 4-10 days range and so on.
@LBarto90 OK, try this then:
Measure =
VAR __Category = [Anzahl krank_Kategorie]
VAR __Table = SUMMARIZE('Table', [Name], "__Count", COUNTROWS('Table'))
VAR __One2Three = COUNTROWS(FILTER(__Table, [__Count]<4))
VAR __MoreThan4 = COUNTROWS(FILTER(__Table, [__Count]>3))
VAR __Result = IF(__Category = "1-3", __One2Three, __MoreThan4)
RETURN
__Result
@LBarto90 If I am understanding correctly, perhaps something like this:
Measure =
VAR __Category = MAX('CategoriesTable'[Category])
VAR __Table = SUMMARIZE('Table', [Name], "__Count", COUNTROWS('Table'))
VAR __One2Three = COUNTROWS(FILTER(__Table, [__Count]<4))
VAR __MoreThan4 = COUNTROWS(FILTER(__Table, [__Count]>3))
VAR __Result = IF(__Category = "1-3", __One2Three, __MoreThan4)
RETURN
__Result
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 |
---|---|
106 | |
105 | |
79 | |
69 | |
62 |
User | Count |
---|---|
142 | |
105 | |
103 | |
85 | |
70 |