Forum Discussion

cottrera's avatar
cottrera
Post Prodigy
4 years ago
Solved

DAX percentage Query

Hi 

 

I have a hard coded number 2,508

 

I also have a table visual for which the % figure will change daily.

Trade% Split
Elec30%
Multi51%
Plumbing10%
ROUTINE_EXTERNAL0%
ROUTINE_INTERNAL0%
UVPC / Carp9%

 

Is it possible to use DAX to calculate the pecentage of the hard coded figure  using the percentages above.

Trade% SplitExpected DAX Result
Elec30%752
Multi51%1269
Plumbing10%253
ROUTINE_EXTERNAL0%0
ROUTINE_INTERNAL0%0
UVPC / Carp9%233

 

 

thanks

 

Richard

  • Hi cottrera ,

    Please try this:-

    Measure =
    VAR Num = 2508
    RETURN
        ( Num * ( [% Split] * 100 ) ) / 100

    Thanks,

    Samarth

4 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi cottrera ,

    Please try this:-

    Measure =
    VAR Num = 2508
    RETURN
        ( Num * ( [% Split] * 100 ) ) / 100

    Thanks,

    Samarth

    • cottrera's avatar
      cottrera
      Post Prodigy

      Thank you Samarth_18 for replying quickly your method worked fine

  • PijushRoy's avatar
    PijushRoy
    Community Champion
    Please use the Calculation 

    Measure =
    VAR HardNum = 2508
    VAR CategoryPercent = SELECTEDVALUE('Table'[% Split])
    Return
    HardNum * CategoryPercent

    IF SOLVED, PLEASE GIVE KUDO


    • cottrera's avatar
      cottrera
      Post Prodigy

      Hi PijushRoy
      Thank you for responding. Unfortunatly this does not resolve me issue as the percentages I am using already come from a DAX functionand cannor be uses here ('Table'[% Split])

       

      The table I showed in my example is a visual table not a data base table the % split is a DAX function