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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Dax function is difficult

Hello, I'm a beginner at Power B.I

There are seven classrooms and there should be seven people per classroom.
Then, you can receive a total of 49 people with a total of 7*7=49, and now 23 people have entered the school, so you have to fill 26 more people.

As you can see in the image, a total of 26 numbers are shown, but if you click each class, the numbers are not correct.

ssdddddd_0-1652933570698.png

ssdddddd_1-1652933576020.png

ssdddddd_2-1652933584025.png


I want to get a number normally.

I need your help
Thank you.

2 ACCEPTED SOLUTIONS
PC2790
Community Champion
Community Champion

Is tis what you are looking for?

PC2790_0-1652951604184.png

Attaching the file here for your reference.

View solution in original post

PC2790
Community Champion
Community Champion

Glad to help 🙂

If your issue is resolved, please mark the answer as solution for others to benefit from it.

Thanks

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

@PC2790 

 

You can go to the url address and download the file.

The powerbi should have a value in the 'card' part.

-> need to STU = (each class * 7) - Total number of students enrolled

 

And if you press each classroom, you can see the number of students that you need

For example, if you press A, the number "card" should be 5 people
It's because two people are currently in class A.

 

URL : https://drive.google.com/drive/folders/1DIDO3Wuw3jj0I9A03eszMfRkk5bQ31RV?usp=sharing

PC2790
Community Champion
Community Champion

Is tis what you are looking for?

PC2790_0-1652951604184.png

Attaching the file here for your reference.

Anonymous
Not applicable

@PC2790 

 

Ohhhhhhh! 

Thanks a lot!
It's amazing!!

😀

PC2790
Community Champion
Community Champion

Glad to help 🙂

If your issue is resolved, please mark the answer as solution for others to benefit from it.

Thanks

Anonymous
Not applicable

You can go to the url address and download the file.
@PC2790 

https://drive.google.com/drive/folders/1DIDO3Wuw3jj0I9A03eszMfRkk5bQ31RV?usp=sharing

You can go to the url address and download the file.

The powerbi should have a value in the 'card' part.

-> need to STU = (each class * 7) - Total number of students enrolled

And if you press each classroom, you can see the number of students that you need

For example, if you press A, the number "card" should be 5 people
It's because two people are currently in class A.

Anonymous
Not applicable

@PC2790 

 

thx.

 

Should I do it like the image I posted?
It's not working....

ssdddddd_1-1652938541638.png

 

PC2790
Community Champion
Community Champion

Can you provide your data model and sample data?

What data type is you class column?

If each class has 7 students and it is fixed then there is no need to multiply it explicitly with 7.

If your Class table contains the number of students, you can get the 7 number from there using:

 

Measure =
var selectedclass = Allselected(Class[Class]) 

var Noofstudentsinclass = Count(Filter('Class', Class[Class] = selectedclass))

return

Noofstudentsinclass - freshman[entrance into a school]

 

If single class has 7 students, then Noofstudentsinclass would always return 7 if one class is selected?Isn't it?

And are you sure you want to subtract freshman[entrance into a school]?

It will be easier to advice further if you can provide some sample data and your expected output.

PC2790
Community Champion
Community Champion

Try:

 

Measure =
var studentsperclass = 7 

return

Calculate('Class',Class[Class] * studentsperclass - freshman[entrance into a school])

 

Make sur eyou ahve relationship between Class and freshman table

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.