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
Swamy3105
Helper IV
Helper IV

filter on multiple slicer and display the value

Hi Experts,

 

I have the table as below :

 

555.JPG

 

 

 

I have the two slicers:

 

1. Country

2. Month

 

what I need is, If I select the country and Month then the measure should calculate the "Jan" column and filter the country column and Code column then values should appear for 6025 against the Item code.

 

 

Capture.JPG

 

please help me to acheive this.

 

Regards

Swamy

 

 

1 ACCEPTED SOLUTION

@v-xicai 

 

thanks for the reply, but already i have found the solution.

 

My measure as below:

 

6025-Functional Finance Advisors =
SWITCH([Selected],"Jan",CALCULATE(MAX(OPEX[Jan]),FILTER(OPEX,OPEX[Code] = "6025")),"Feb",CALCULATE(MAX(OPEX[Feb]),FILTER(OPEX,OPEX[Code]= "6025")),"Mar",CALCULATE(MAX(OPEX[Mar]),FILTER(OPEX,OPEX[Code] = "6025")),"Apr",CALCULATE(MAX(OPEX[Apr]),FILTER(OPEX,OPEX[Code] = "6025")),"May",CALCULATE(MAX(OPEX[May]),FILTER(OPEX,OPEX[Code] = "6025")),"Jun",CALCULATE(MAX(OPEX[Jun]),FILTER(OPEX,OPEX[Code] = "6025")),0)
 
Thanks,
Swamy

View solution in original post

6 REPLIES 6
v-xicai
Community Support
Community Support

Hi @Swamy3105 ,

 

You may combine all month columns into one month column, enter into Query Editor, click on all the month columns at the same time, go to transfer->Unpivot Columns to get picture 2, you can rename the column Attribute to Month, click "Close & Apply" button.

72.png73.png

Then you can put the month into Slicer visual, create measure to get sum total like DAX below.

 

 

6025= CALCULATE(SUM(OPEX[Value]),FILTER(ALLSELECTED(OPEX), OPEX[Month] =MAX(OPEX[Month])&&OPEX[Code] = "6025"))

 

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xicai 

 

thanks for the reply, but already i have found the solution.

 

My measure as below:

 

6025-Functional Finance Advisors =
SWITCH([Selected],"Jan",CALCULATE(MAX(OPEX[Jan]),FILTER(OPEX,OPEX[Code] = "6025")),"Feb",CALCULATE(MAX(OPEX[Feb]),FILTER(OPEX,OPEX[Code]= "6025")),"Mar",CALCULATE(MAX(OPEX[Mar]),FILTER(OPEX,OPEX[Code] = "6025")),"Apr",CALCULATE(MAX(OPEX[Apr]),FILTER(OPEX,OPEX[Code] = "6025")),"May",CALCULATE(MAX(OPEX[May]),FILTER(OPEX,OPEX[Code] = "6025")),"Jun",CALCULATE(MAX(OPEX[Jun]),FILTER(OPEX,OPEX[Code] = "6025")),0)
 
Thanks,
Swamy
Mariusz
Community Champion
Community Champion

Hi @Swamy3105 

 

You can Unpivot your data in Query Editor.

Go to >  Edit Queries > Select Your Table > Select All the Month Columns >  Click Unpivot Columns as below

 

image.png

This will create two columns Attribute for Months and Value for your Values

Now you can rename Attribute column to Month and use it in a slicer

 

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

 

@Mariusz 

 

the Month column is a calculated column.

 

whenever I select month from slicer then the value should filtered and change based on the slection .

@Swamy3105 

 

I was referring to Month Columns ( Jan, Feb ....) 


Hope this helps.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.


 

@Mariusz 

 

it's not working.

I have a measure as below:

 

6025 = var a = VALUES('Month'[Month]) return CALCULATE(SUM(OPEX[Jan]),FILTER(OPEX,OPEX[Code] = "6025"))
 
what I need is I want to calculate the Feb month as well for this code "6025"   in the same measure.
 
Any idea?
 
 
 

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.