Forum Discussion

pstanek's avatar
pstanek
Post Patron
10 years ago
Solved

Dax

Measure1  = Calculate(
SUM(movement[pcena]);
FILTER(movement; movement[date] >= NOW()-30 && movement[date] <= NOW()))

Measure2  = Calculate(
SUM(movement[pcena2]);
FILTER(movement; movement[date] >= NOW()-30 && movement[date] <= NOW()))

 

Measure3=IF([Measure1]<>0,[Measure1]/[Measure2],0).

 

Can you tell me, where is the mistake in syntax in Measure3.

measure 1 = CALCULATE(SUM(movement[date]); movement[date]>NOW()-30; movement[date] <= NOW()).

Can you tell me ,what the difference bettweenn Measure1 a measure 1 is?

 

Problem 2

I have two tables with relation in query.

A->B

Table A includes column Office and revenue.

Table B includes  column Office and parameter.

I want to create report Office Revenue/parameter . How will I create it in DAX.

 

I need this solve fast as I can.

  • Sean's avatar
    Sean
    10 years ago

    pstanek This should work for a Calculated Column in Table A

     

    Column = TableA[Pcena] * RELATED ( TableB[Parameter_n] )

6 Replies

  • Sean's avatar
    Sean
    Community Champion

    pstanek Besides that . at the end of Measure3 there's nothing wrong with that formula

     

    The difference between Measure1 and measure 1 - is the evaluation context - best way to explain/show is with a picture

    Measure1 is the way to go even tough you get the same overall result in the bottom Total Row

     

    Go to the Relationship View => select Column Office in either table => drag and point to column Office in the other table

    The relationship will be established

     

    Hope this helps. Le me know...

    • pstanek's avatar
      pstanek
      Post Patron

      Measure 3 didn´t t work. Sometimes It writes something about function filter, that I can not be used in fuctions If and similar functions

       

      I have already established relationship, but i don´t know How to create column in Table A .

      Table a

      Office1  goods1 Pcena1

      Office1  goods2 Pcena2

      Office2  goods1 Pcena3

       

      Table B

      Office_n parameter_n

      Column should have values

      Pcena*VLooklup(office_ n)

       

      It means

      Office1  goods1 Pcena1 Pcena1*VLooklup(office_ 1)

      Office1  goods2 Pcena2 Pcena2*VLooklup(office_ 1)

      Office2  goods1 Pcena3 Pcena3*VLooklup(office_ 2)

       

      Vlookup will find parameterin Table B

      • Sean's avatar
        Sean
        Community Champion

        pstanek This should work for a Calculated Column in Table A

         

        Column = TableA[Pcena] * RELATED ( TableB[Parameter_n] )
    • pstanek's avatar
      pstanek
      Post Patron

      Can you tell new, which one is faster? Measure1 , or measure1

       

      I have data, where Measure 1 is too slow. Results are not often calculated. I can even tell, I am at BI mercy, If results appear, or not.