Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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:
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?
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
Regards,
Harsh Nathani
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]
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |