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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dkretzer
New Member

Month Select Slicer use value in calculation

Hi everyone, long time lurker, first time poster.

I have a bar chart that compares a Sales person's actual sales versus quota. Quota is figured at $60K/m.

I have a date slicer that uses the Actual Revenue Sold( "Close Date") date, and shows only the month (dont care about the particular day, only the month).

I need my chart to show the accumultive quota for a specific month. Example: January should be 60K, February 120K,...

I have tried using SELECTEDVALUE in several ways. Selectedvalue('Weekly Overview'[Close Date].[Month No])*60000 is halfway successful, but doesn't work when multiple months are selected. It will show February quota as 120K, but because this limits my revenues to just february, I need it to show: Revenues (Jan+Feb), Quota (Feb->2*60000).

 

Any help is greatly welcomed!

1 ACCEPTED SOLUTION
v-jianpeng-msft
Community Support
Community Support

Hi, @dkretzer 

Based on your description, I have created the following sample data:

vjianpengmsft_0-1717729815380.png

The Index column corresponds to the month number. I made a slicer and a bar chart based on your description as follows:

vjianpengmsft_1-1717729915121.png

For multi-select cases, we need to use the seletcolumn function to configure the addcolumn function to achieve the effect you are talking about.

Measure = 
VAR _table = SELECTCOLUMNS('Table','Table'[Index])
VAR _table1 = ADDCOLUMNS(_table,"quota",'Table'[Index]*60000)
RETURN MAXX(FILTER(_table1,'Table'[Index]=SELECTEDVALUE('Table'[Index])),[quota])

The first variable _table take out multiple values selected by the slicer to form a virtual table. The second variable _table1 add a column to the _table to calculate the quota for the selected month. Finally, the quota of the quota column in the _table1 that corresponds to the current x-axis is returned.

Here are the results:

vjianpengmsft_2-1717730155852.png

I've uploaded the PBIX file I used this time below.

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

 

 

View solution in original post

1 REPLY 1
v-jianpeng-msft
Community Support
Community Support

Hi, @dkretzer 

Based on your description, I have created the following sample data:

vjianpengmsft_0-1717729815380.png

The Index column corresponds to the month number. I made a slicer and a bar chart based on your description as follows:

vjianpengmsft_1-1717729915121.png

For multi-select cases, we need to use the seletcolumn function to configure the addcolumn function to achieve the effect you are talking about.

Measure = 
VAR _table = SELECTCOLUMNS('Table','Table'[Index])
VAR _table1 = ADDCOLUMNS(_table,"quota",'Table'[Index]*60000)
RETURN MAXX(FILTER(_table1,'Table'[Index]=SELECTEDVALUE('Table'[Index])),[quota])

The first variable _table take out multiple values selected by the slicer to form a virtual table. The second variable _table1 add a column to the _table to calculate the quota for the selected month. Finally, the quota of the quota column in the _table1 that corresponds to the current x-axis is returned.

Here are the results:

vjianpengmsft_2-1717730155852.png

I've uploaded the PBIX file I used this time below.

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.