Forum Discussion

Vipulgoel's avatar
Vipulgoel
New Member
4 years ago
Solved

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

Output as follows:

 

 

Any help will be highly appreciated, thanks.

6 Replies

  • 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!! 

    LinkedIn | Twitter | Blog | YouTube 

    • Vipulgoel's avatar
      Vipulgoel
      New Member

      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

  • SpartaBI's avatar
    SpartaBI
    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))

     





          

    Showcase Report – Contoso By SpartaBI