Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Irisohyama6
Frequent Visitor

Group results from a measure.

Hi,

 

I have a table that looks like this:

Irisohyama6_1-1649194310193.png

I created a table visual to count the attendence for each name:

Irisohyama6_2-1649194356031.png 

 

[# Attendence = Yes] = COUNTROWS(FILTER('Table','Table'[Attendance]="Yes"))

 

 

What I want to achieve is this:

Irisohyama6_4-1649194620991.png

 

 

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. 

 

Irisohyama6_5-1649194732759.png

 

 

# 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. 

 

 

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

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/

 

 

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

This can be done just with a measure.  Share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I don't know how to attach a pbix file here because it says. 

Irisohyama6_0-1649205960588.png

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.

 

EventNameAttendance
AFieldNo
AJessicaYes
AJonYes
ASmallYes
BDesmondYes
BFieldNo
BJonYes
BSmallYes
CDesmondNo
CFieldNo
CJessicaYes
CJonNo
CSmallYes

 

 

# 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.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
VahidDM
Super User
Super User

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/

 

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.