Forum Discussion
Dynamic Calculation based on the slicer selection
I am new to Power BI and I am stuck with this problem.
I have a dataset that has multiple columns. I want to create two slicers based on a single column `ID`, One is Base and the other is Reference, Based on user preferences of Base & Reference Slicer, I want to calculate the difference of Count and the calculation will be plotted as line/bar graph. Here ID Column can have multiple values, Here I have shown only 2 values.
I am facing a problem with the slicer, If I select a value in the Base Slicer, the same value is also shown in the Reference Slicer, and the difference of count based on the slicer values.
| Year | Batch | Group | Type | ID | Count |
| 2020 | A1 | Science | Gold | A1-2020 | 5 |
| 2020 | A1 | Commerce | Gold | A1-2020 | 4 |
| 2020 | A1 | Arts | Gold | A1-2020 | 5 |
| 2020 | A1 | Science | Silver | A1-2020 | 12 |
| 2020 | A1 | Commerce | Silver | A1-2020 | 3 |
| 2020 | A1 | Arts | Silver | A1-2020 | 4 |
| 2020 | A1 | Science | Platinum | A1-2020 | 5 |
| 2020 | A1 | Commerce | Platinum | A1-2020 | 6 |
| 2020 | A1 | Arts | Platinum | A1-2020 | 1 |
| 2020 | A2 | Science | Gold | A2-2020 | 2 |
| 2020 | A2 | Commerce | Gold | A2-2020 | 4 |
| 2020 | A2 | Arts | Gold | A2-2020 | 5 |
| 2020 | A2 | Science | Silver | A2-2020 | 3 |
| 2020 | A2 | Commerce | Silver | A2-2020 | 1 |
| 2020 | A2 | Arts | Silver | A2-2020 | 4 |
| 2020 | A2 | Science | Platinum | A2-2020 | 5 |
| 2020 | A2 | Commerce | Platinum | A2-2020 | 5 |
| 2020 | A2 | Arts | Platinum | A2-2020 | 6 |
Hi,
PBI file attached.
Hope this helps.
8 Replies
- Ashish_MathurSuper User
- sobm_1092Regular Visitor
Thanks a lot. Is it possible to do with slicer, cause there is multiple values in the ID column, like A1-2020, A1-2021, A1-2022, A2-2020, A2-2021, A2-2022. From there user can select which one they want as a base and which one they want as reference.
- Ashish_MathurSuper User
Slicer is what i have used on the page. I have done it with a single slicer. The user can select any 2 options in the single slicer.
- YanqingNew Member
split "ID" column into 2 columns would help?