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
Anonymous
Not applicable

noob question, sum by status

I have this activity table with unique lines for each status on a course for a customer:

 

CustomerID Course         Status              Type

0001            Course1       Signed up        E-learning

0002            Course2       Signed up        Classroom

0003            Course2       Not signed up Classroom

0004            Course2       Signed up        Classroom

0005            Course1       Not signed up E-learning

 

And I am trying to get this overview table:

 

Course        Type              Sum signed up        Sum not signed up

Course1      E-learning     1                              1

Course2      Classroom     2                              1

 

I am quite new to PowerBI and trying to find out how to add a measure that gives me a table like that. Any help will be very appreciated

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Option one.

In matrix visual  Course and Type on row. Status on column and 

measure = countrows(Table) on  values

 

of use two measures

sum Signed up = countrows(filter( Table, Table[Status]= "Signed up"))

 

sum Not Signed up = countrows(filter( Table, Table[Status]= "Not Signed up"))

 

View solution in original post

Samarth_18
Community Champion
Community Champion

Hi @Anonymous 

you can create two measure like below:-

Sum not signed up = CALCULATE(COUNT('Table'[Status ]),'Table'[Status ] = "Not signed up")
Sum signed up = CALCULATE(COUNT('Table'[Status ]),'Table'[Status ] = "Signed up")

Output:-

Samarth_18_0-1640081399809.png

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

Pragati11
Super User
Super User

Hi @Anonymous,

 

You can achieve this in Power Query Editor in Power BI Desktop.

This is thhe data that you shared:

Pragati11_1-1640081377280.png

Right Click on Customer ID column and select Remove. You will get:

Pragati11_2-1640081426633.png

Right-click on Course column and Duplicate it. You will get:

Pragati11_3-1640081483366.png

Now just drag Course-copy column to the left and bring it just before Type column. See below:

Pragati11_4-1640081545164.png

Just select Course-copy and Type columns (Ctrl+click on Windows machine) --> Right click --> Merge

Pragati11_6-1640081643334.png

Once you merge both column you will get:

Pragati11_7-1640081677007.png

Now select Status column and under Transform on top ribbon select pivot column option. You will get a new window:

Pragati11_8-1640081785806.png

Just click OK here and you will get the following:

Pragati11_9-1640081822230.png

Now we are just 1step away from the desired output.

 

Select Merged column and on top ribbon Split by delimiter:

Pragati11_10-1640081909653.png

A new window opens. Just make sure to have following options and then click ok:

Pragati11_11-1640081977170.png

You will get following:

Pragati11_12-1640082005084.png

Now just rename the highlighted columns (right-click on column and choose rename) and you will get your desired results:

Pragati11_13-1640082107122.png

 

Thanks,

Pragati

 

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Thanks, all! I might use a mix of your suggested solutions 🙂

HI @Anonymous ,

 

Please mark the helpful suggestions as solutions to this thread as these may help others on the forum as well. 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Pragati11
Super User
Super User

Hi @Anonymous,

 

You can achieve this in Power Query Editor in Power BI Desktop.

This is thhe data that you shared:

Pragati11_1-1640081377280.png

Right Click on Customer ID column and select Remove. You will get:

Pragati11_2-1640081426633.png

Right-click on Course column and Duplicate it. You will get:

Pragati11_3-1640081483366.png

Now just drag Course-copy column to the left and bring it just before Type column. See below:

Pragati11_4-1640081545164.png

Just select Course-copy and Type columns (Ctrl+click on Windows machine) --> Right click --> Merge

Pragati11_6-1640081643334.png

Once you merge both column you will get:

Pragati11_7-1640081677007.png

Now select Status column and under Transform on top ribbon select pivot column option. You will get a new window:

Pragati11_8-1640081785806.png

Just click OK here and you will get the following:

Pragati11_9-1640081822230.png

Now we are just 1step away from the desired output.

 

Select Merged column and on top ribbon Split by delimiter:

Pragati11_10-1640081909653.png

A new window opens. Just make sure to have following options and then click ok:

Pragati11_11-1640081977170.png

You will get following:

Pragati11_12-1640082005084.png

Now just rename the highlighted columns (right-click on column and choose rename) and you will get your desired results:

Pragati11_13-1640082107122.png

 

Thanks,

Pragati

 

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Samarth_18
Community Champion
Community Champion

Hi @Anonymous 

you can create two measure like below:-

Sum not signed up = CALCULATE(COUNT('Table'[Status ]),'Table'[Status ] = "Not signed up")
Sum signed up = CALCULATE(COUNT('Table'[Status ]),'Table'[Status ] = "Signed up")

Output:-

Samarth_18_0-1640081399809.png

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

amitchandak
Super User
Super User

@Anonymous , Option one.

In matrix visual  Course and Type on row. Status on column and 

measure = countrows(Table) on  values

 

of use two measures

sum Signed up = countrows(filter( Table, Table[Status]= "Signed up"))

 

sum Not Signed up = countrows(filter( Table, Table[Status]= "Not Signed up"))

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.