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