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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Fariba1984
Frequent Visitor

create new measure on base of another Measure

Hi experts,

 

I am new in dax I would like to ask you a simple question. I would like to do some mathematical operation on rows:

 

2020-08-06 09_05_54-Mappe1 - Excel.png

 

New Measure should be the subtract of the result in each row. For example 0,503041391 - 0,5 ,  0,503041391 - 0,503164557,....

I have defined such a dax but it returns me only 0:

 

NewMeasure:=
var _avg =[Measure1]
return 
CALCULATE([Measure1] - _avg; Table1  ;Table1[Date_SID] )

 

 

What should I do to solve my problem? 

2 REPLIES 2
harshnathani
Community Champion
Community Champion

Hi @Fariba1984 ,

 

Understand you are using a Calendar Table.

 

Make sure you have a date calendar and it has been marked as the date in model view.
Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

 

Then your new Measure will be

 

 

Yesterday = CALCULATE([Measure], DATEADD(Dates[Date] ,-1,DAY))

 

 

and Difference Measure will be

 

Difference = [Measure] - [Yesterday]

 

 

It will look something like this 

1.jpg

 

Regards,

Harsh Nathani

 

az38
Community Champion
Community Champion

@Fariba1984 

it's obviously.

you always deduct var _avg (which is equal [Measure1]) from [Measure1].

It always will be zero

 

It's also unclear what do you mean with this part 

;Table1 ;Table1[Date_SID]


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.