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

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.

Reply
Rayzo92
Helper I
Helper I

Create a measure grouped by another column

Greeting members ,

 

im having an issue to create a filter on one of my visual tables on Power BI ! i will try to make my problem simple via using a sample.

let's say a table of students with their exam note , exam start time and exam end time : 

Rayzo92_0-1672928300696.png

 

 

i wanted to create a table where i have the students having more than 100 notes which is easy , i created a measure " total = Sum(student[Note])" , than i filtered on that measure in the filter panel (Total => 100) 

 

Rayzo92_1-1672855319778.png

 

The problem here is that when i wanted to create another table where i add the start and the end time , the result wont be correct since the total will be divised (only the green row will be shown since it is already over 100)

 

Rayzo92_0-1672854866278.png

 

my object in the second table to have the students with more or equal to 100 while adding the start and end time .

 

this is my final table how it should be : 

Rayzo92_1-1672855005442.png

 

Thanks all in advance.

Best regards.

1 ACCEPTED SOLUTION

Hi , @Rayzo92 

Thanks for your quick response!

If you want to calculate the sum of [Note] group by the [ID], you can create a measure:

Note Value = CALCULATE( SUM('Table'[Note]) ,ALLEXCEPT('Table','Table'[ID]))

 

And then just put the measure on the visual and also on the "Filter on this visual" and then we can meet your need:

vyueyunzhmsft_0-1672967211400.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

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

 

View solution in original post

4 REPLIES 4
v-yueyunzh-msft
Community Support
Community Support

 Hi , @Rayzo92 

According to your image , do you mean you want to show the [Note]> 100 in the visual ?
If this , here are the steps you can refer to :
(1)This is my test data :

vyueyunzhmsft_0-1672885250143.png

(2)We can create a measure :

Flag = var _cur_note = MAX('Table'[Note])
return
IF(_cur_note>100,1,0)

(3)Then we can put the measure on the "Filter on this visual" and we can meet your need:

vyueyunzhmsft_1-1672885308097.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

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

 

Thanks for your reply , 

Actually i made a mistake when i create the dataset  here the correct one (i edited on my post aswell) : 

 

Rayzo92_0-1672928543047.png

 

i think i need to create a specefic measure but not sure if allexpect work here in this case , thanks in advance 

 

Hi , @Rayzo92 

Thanks for your quick response!

If you want to calculate the sum of [Note] group by the [ID], you can create a measure:

Note Value = CALCULATE( SUM('Table'[Note]) ,ALLEXCEPT('Table','Table'[ID]))

 

And then just put the measure on the visual and also on the "Filter on this visual" and then we can meet your need:

vyueyunzhmsft_0-1672967211400.png

 

 

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

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

 

IIPowerBlog
Helper I
Helper I

hi @Rayzo92  . I have answered this before in anotjher (similar) question, check out my blog for the answer:

https://www.iipowerblog.com/post/sum-over-partition-by-in-powerbi 

This has worked for me. What you need is a SUM() OVER PARTITION BY type of measure in Power BI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.