Forum Discussion

Kurumi0418's avatar
Kurumi0418
Helper I
8 years ago
Solved

How to make Column = Measure values????

 

Hello everyone,

 

I have question, How to make Column = Measure values????

 

Because I want use measure show to X axis. 

 

thanks.

  • Hi Kurumi0418,

     

    "First : I don't know why I use same rule, but value is different ( Measure & Column)"

    <--  Sum in measure will aggregate values based on other columns while calculate column will not.

     

    Second : I use ALLEXCEPT function in Column, so value is the same with Measure, But if I filiter any Feature, It's donesn't change.

    <-- Dynamic calculate column is not supported in power bi. If you want to achieve dynamic values in chart, you should use measure instead. Refer to: Dynamic column based on slicer selection

     

    Regards,

    Jimmy Tao

  • Thejeswar's avatar
    Thejeswar
    8 years ago

    Kurumi0418,

    First of all, I didn't specifically IF RuleOut = 0, because, 0 divided by anything will automatically become 0 and hence only handling divide by 0 for WIP is enough

     

    Secondly, the Values are coming right when using the DAX I shared earlier as shown below. Here I have added two of my own values to show you the scenarios.

    Both Column and Measure displayed

     

     

    The Below are the DAX Statements that I used for Column and Measure

     

    Column = IF(WAITING_TIME_REPORT_HISTORY[WIP] = 0, 0, DIVIDE(WAITING_TIME_REPORT_HISTORY[Rule Out],WAITING_TIME_REPORT_HISTORY[WIP])) 
    Measure = IF(SUM(WAITING_TIME_REPORT_HISTORY[WIP])=0, 0, DIVIDE(SUM(WAITING_TIME_REPORT_HISTORY[Rule Out]), SUM(WAITING_TIME_REPORT_HISTORY[WIP]))) 

    So it shouldn't be a problem with the DAX statement used. May be something else is causing the issue.

6 Replies

  • Phil_Seamark's avatar
    Phil_Seamark
    Microsoft Employee

    Typically column fields go on your axis, while measures are values that you plot or chart on your visual.  There are exceptions, but can you please provide more detail about what you are trying to do.

    • Kurumi0418's avatar
      Kurumi0418
      Helper I

       

      First : I don't know why I use same rule, but value is different ( Measure & Column)

      Measure : DIVIDE(SUM('WAITING_TIME_REPORT_HISTORY'[Rule Output]),SUM('WAITING_TIME_REPORT_HISTORY'[WIP]))

      Column : DIVIDE(SUM('WAITING_TIME_REPORT_HISTORY'[Rule Output]),SUM('WAITING_TIME_REPORT_HISTORY'[WIP]))

      notice : Rule out or WIP passibile = "0"

       

      Second : I use ALLEXCEPT function in Column, so value is the same with Measure, But if I filiter any Feature, It's donesn't change.

      Measure : DIVIDE(SUM('WAITING_TIME_REPORT_HISTORY'[Rule Output]),SUM('WAITING_TIME_REPORT_HISTORY'[WIP]))

      Column : CALCULATE(DIVIDE(sum(WAITING_TIME_REPORT_HISTORY[Rule Output]),sum(WAITING_TIME_REPORT_HISTORY[WIP])),ALLEXCEPT(WAITING_TIME_REPORT_HISTORY,WAITING_TIME_REPORT_HISTORY[GROUP_PROCESS]))

      measure <> column values


       

      So. I going to this community find solution, help me. thanks.

      • Thejeswar's avatar
        Thejeswar
        Super User

        Kurumi0418,

        Your column DAX Statement should be changed a bit

         

        Column : DIVIDE(SUM('WAITING_TIME_REPORT_HISTORY'[Rule Output]),SUM('WAITING_TIME_REPORT_HISTORY'[WIP]))

        To handle NULLS, use if statement

         

        Column : IF('WAITING_TIME_REPORT_HISTORY'[WIP] = 0, 0, DIVIDE('WAITING_TIME_REPORT_HISTORY'[Rule Output],'WAITING_TIME_REPORT_HISTORY'[WIP]))

         

        Basically, to divide values at the level of each record, you should not sum the values of the Numerator and Denominator. In Measures, you sum the values of Numerator and Denominaor, because he measure will automatically aggregate them to different level of attributes in your visual. But calculated columns do not work that way. They work record by record in the level they are calculated.

         

        In your below formula,

        "Column : CALCULATE(DIVIDE(sum(WAITING_TIME_REPORT_HISTORY[Rule Output]),sum(WAITING_TIME_REPORT_HISTORY[WIP])),ALLEXCEPT(WAITING_TIME_REPORT_HISTORY,WAITING_TIME_REPORT_HISTORY[GROUP_PROCESS]))"

         

        You have written like, Remove all context filters in the table except filters that have been applied to WAITING_TIME_REPORT_HISTORY[GROUP_PROCESS]. So it would also not filter for the selections that you make

         

        Hope this solves your issue!!!