Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
pstanek
Post Patron
Post Patron

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.

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@pstanek This should work for a Calculated Column in Table A

 

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

View solution in original post

6 REPLIES 6
Sean
Community Champion
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

Dax.png

 

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...

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.

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
Community Champion
Community Champion

@pstanek This should work for a Calculated Column in Table A

 

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

Thanks, I was stepping around.

 

Do you know some really good Dax library or books  for Power Bi. I mean, I would like to see not only codes, but with easy  examples.

Tables, what we want  to calculate., results

 

I always find code, tables - not described in detail where I can not say what It means. Result is that, I know function related, but I can not use it effectively.Cat Happy

Sean
Community Champion
Community Champion

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.