Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I have a table that looks like this:
I created a table visual to count the attendence for each name:
[# Attendence = Yes] = COUNTROWS(FILTER('Table','Table'[Attendance]="Yes"))
What I want to achieve is this:
My attempt:
I was trying to create a new table so I can plot the graph. I know how to create the red box part, but I don't know how to create a column for the blue box that count the occurence of the [# Attendence = Yes] part.
# Max Attendence =
MAXX(
KEEPFILTERS(VALUES('Table'[Name])),
CALCULATE([# Attendence = Yes])
)
I understand there are many ways of doing this, I am open for any solutions.
Thank you in advance.
Solved! Go to Solution.
Hi @Irisohyama6
You can create a new table with this DAX code and use that to create your visual:
New Table =
VAR _A =
GROUPBY (
FILTER (
SUMMARIZE (
'Table',
'Table'[Name],
"Att",
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', 'Table'[Attendance] = "Yes" )
)
),
[Att] <> BLANK ()
),
[Att],
"O", COUNTAX ( CURRENTGROUP (), [Att] )
)
RETURN
_A
Sample file attached, please download.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi,
This can be done just with a measure. Share the link from where i can download your PBI file.
I don't know how to attach a pbix file here because it says.
If you can show me how It would be great!
I will draw a table using the table tool, and also show you the measures I used.
Event | Name | Attendance |
A | Field | No |
A | Jessica | Yes |
A | Jon | Yes |
A | Small | Yes |
B | Desmond | Yes |
B | Field | No |
B | Jon | Yes |
B | Small | Yes |
C | Desmond | No |
C | Field | No |
C | Jessica | Yes |
C | Jon | No |
C | Small | Yes |
# Max Attendence =
MAXX(
KEEPFILTERS(VALUES('Table'[Name])),
CALCULATE([# Attendence = Yes])
)
Table 2 = GENERATESERIES(1,[# Max Attendence],1)
Thank you 😊
Hi,
You may download my PBI file from here.
Hope this helps.
Hi @Irisohyama6
You can create a new table with this DAX code and use that to create your visual:
New Table =
VAR _A =
GROUPBY (
FILTER (
SUMMARIZE (
'Table',
'Table'[Name],
"Att",
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( 'Table', 'Table'[Attendance] = "Yes" )
)
),
[Att] <> BLANK ()
),
[Att],
"O", COUNTAX ( CURRENTGROUP (), [Att] )
)
RETURN
_A
Sample file attached, please download.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
User | Count |
---|---|
107 | |
88 | |
81 | |
76 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |