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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors