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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors