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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sobm_1092
Regular Visitor

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.

YearBatch GroupTypeIDCount
2020A1ScienceGoldA1-20205
2020A1CommerceGoldA1-20204
2020A1ArtsGoldA1-20205
2020A1ScienceSilverA1-202012
2020A1CommerceSilverA1-20203
2020A1ArtsSilverA1-20204
2020A1SciencePlatinumA1-20205
2020A1CommercePlatinumA1-20206
2020A1ArtsPlatinumA1-20201
2020A2ScienceGoldA2-20202
2020A2CommerceGoldA2-20204
2020A2ArtsGoldA2-20205
2020A2ScienceSilverA2-20203
2020A2CommerceSilverA2-20201
2020A2ArtsSilverA2-20204
2020A2SciencePlatinumA2-20205
2020A2CommercePlatinumA2-20205
2020A2ArtsPlatinumA2-20206
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1710036093614.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Yanqing
New Member

split "ID" column into 2 columns would help?

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1710036093614.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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. 

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Pic 1Pic 1

Pic 2Pic 2Pic 3Pic 3

 

Please see the attached Images. I have added another case A3-2020, I want to implement 2 different slicer. But after i choose Base id slicer, reference Id slicer shows the same value. How can i overcome this. 

 

Thanks a lot for your response.

That will just complicate the solution.  When you can achieve your desired result with a single slicer, why are you creating another one?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

You are correct about complicating things but I was facing the same issue with 2 slicer on same column. I tried but I couldn't do so. That's why I wanted to do this.

Thanks a lot for your prompt response, you have helped me a lot. 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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