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.
Hello All.
First off, I am new to power BI, so please bear with me (I am hoping I have included all necessary information).
I have searched to see if there were previous questions asked that are similar to my question but looking at other solutions, these solutions did not seem to fit exactly what I was looking for.
The sample data I am working with is classes, and number of students who attended those classes, and dates attended(screenshot below).
I was wondering if it was possible to group classes together, and then use the group as a slicer.
For example lets say class1 & class2 are math classes, class3 and class4 are history classes, class5 and class6 are science classes.
I would then like to have a filter/slicer with options of math, history, science, so when when I select math, only class1 and class2 data are shown.
I am not sure if what I am wanting to do is possible.
Any help is appreciated.
Thank you in advance.
Solved! Go to Solution.
Hi,
Click on Edit Queries and right click on the first column > Unpivot Other columns. Click on Add Column > Custom column and write this M formula there
=if [Attribute]="class1" or [Attribute]="class2" then "Maths Classes" else if [Attribute]="class3" or [Attribute]="class4" then "History Classes" else "Science classes"
Alternatively, after unpivoting, click on Close and Load. Then go to Data Modelling and write this calculated column formula
=IF(OR([Attribute]="Class1",[Attribute]="Class2"),"Maths Classes",IF(OR([Attribute]="Class3",[Attribute]="Class4"),"History Classes","Science Classes"))
Hope this helps.
Hi,
Click on Edit Queries and right click on the first column > Unpivot Other columns. Click on Add Column > Custom column and write this M formula there
=if [Attribute]="class1" or [Attribute]="class2" then "Maths Classes" else if [Attribute]="class3" or [Attribute]="class4" then "History Classes" else "Science classes"
Alternatively, after unpivoting, click on Close and Load. Then go to Data Modelling and write this calculated column formula
=IF(OR([Attribute]="Class1",[Attribute]="Class2"),"Maths Classes",IF(OR([Attribute]="Class3",[Attribute]="Class4"),"History Classes","Science Classes"))
Hope this helps.
THANK YOU THANK YOU THANK YOU!
This was exactly what I was looking for.
I appreciate your help and walking me through this.
You are welcome.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |