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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Vipulgoel
New Member

Multiple Output with Slicer Value

Hi All,

 

I have a table with 3 columns in it ( Year, Job ID, Amount). I want to use the year column in the slicer value and upon selecting anything from that slicer the maximum of the Job ID and the Amount corresponding to it should be given as output.

 

Input Table

SS1.PNG

Output as follows:

 

ss2.PNG

 

Any help will be highly appreciated, thanks.

1 ACCEPTED SOLUTION

hurray-vp7m1t.jpg

Hi @SpartaBI 

 

That solution worked, thanks a lot 🙂

 

Regards

Vipul

View solution in original post

6 REPLIES 6
SpartaBI
Community Champion
Community Champion

@Vipulgoel please try:

 

Max Job ID = 
VAR _Year = selectedvalue('table'[year])
RETURN
Calculate(max('table'[Job ID]),filter(all('table'),'table'[Year]=_Year))


Max Amount =
VAR _Year = selectedvalue('table'[year]) 
VAR _JobID = Calculate(max('table'[Job ID]),filter(all('table'),'table'[Year]=_Year))
RETURN
Calculate(max('table'[Amount]),filter(all('table'),'table'[Job ID]=_JobID) && 'table'[Year]=_Year))

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Anonymous
Not applicable

Hi @SpartaBI ,

 

I have a similar request but is that possible to attain the same in calculated columns instead of measure.

 

Any help will be appreciated.

 

Regards

Vipul

hurray-vp7m1t.jpg

Hi @SpartaBI 

 

That solution worked, thanks a lot 🙂

 

Regards

Vipul

@Vipulgoel hahaha my pleasure 🙂
Please don't forget to accept the previous message as a solution for community visibility and check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. 
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂

VahidDM
Super User
Super User

Hi @Vipulgoel 

 

You can add those 2 columns to the table or other visuals and set the aggregation to MAX or you need two measures to find the max Job ID and Related Amount based on the selected date:

Max Job ID = 
Var _Year = selectedvalue('table'[year])
Return
Calculate(max('table'[Job ID]),filter(all('table'),'table'[Year]=_Year))


Max Amount = 
Calculate(max('table'[Job ID]),filter(all('table'),'table'[Job ID]=[Max Job ID]))

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Hi @VahidDM

 

With this solution I am getting correct value for Max Job Id Measure based on the slicer selection but the value for Max Amount Measure is not coming correct. The Max Amount Measure is just returning the Maximum value in the Job ID column.

 

Regards

Vipul

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.