Forum Discussion

ketan10's avatar
ketan10
Advocate III
8 years ago

Need Help | Dynamically change 'maximum' value in the GAUGE visual based on Top 5/10/25/ALL

Can we have a dynamic 'maximum value' in a gauge based on Top 5/10/25/ALL selection ?



Here is the scenario

1. I have a table with the following columns.


2. I am calculating following two measures:

Shipment Count = DISTINCTCOUNT(tblImportMaster[BillLadingNo])
Sum of Weight = SUM(tblImportMaster[Weightkg])

Using these two measures I am calculating a third measure as follows:

Volume = [Shipment Count] * [Sum of Weight]

3. In this step, I am calculating RANK by Sellers w.r.t Volume

SellerRankByMeasure = RANKX(ALL(tblImportMaster[Shipper]),[Volume],,DESC)

4. Now, I have a slicer for Top 5/10/25/ALL. Using this custom slicer that is created, we are filtering the records by the following measure:

SellerRankVolume = IF([SellerRankByMeasure]<=[SelectedTopNValue],[Volume])

 

So if I plot the following visual in a table, it works fine. However if I want to change this volume dynamically based on the Top 5/10/25/ALL
slicer, it does not reflect the 'sliced' value in the GAUGE.


Can we have a value in the gauge (in the maximum section) to be filtered dynamically ?


Any help here would be appreciated. Thank you Smiley Happy

2 Replies

  • Hello,

     

    do you know where the 2470 comes from?

    What would be the expected result?

    Does value change if you change your slicer?

     

    Best regards.

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    Hi ketan10,

     

    TopN is a calculate column and SelectedTopNValue is a measure, right?

     

    If you are using single selection, you can refer to this pattern:

    [SelectedTopNValue] =
    SELECTEDVALUE ( Table[TopN] )

     If you are using multiple selection, you can refer to this pattern:

    [SelectedTopNValue] =
    CALCULATE ( SUM ( Table[TopN] ), ALLSELECTED ( Table[TopN] ) )

    Hope it's helpful.

     

    Regards,

    Jimmy Tao