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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
sportive92003
Helper II
Helper II

same period last year dax and column

Hello,

 

I need to create this information: ID_transaction2 is a Column in the datebase and same period Montant is a calculate column (Same period Montant = CALCULATE([Montant tous], DATEADD(Dates[Date], -1,YEAR)))

. I wrote:

Prevision =

if [ID transaction2]=("BLEU") then [same period Montant]*1.12

if [ID transaction2]=("BLANC") then [same period Montant]*1.2

if [ID transaction2]=("JAUJNE") then [same period Montant]*1.12

but does't work

Thanks!

3 REPLIES 3
Syk
Super User
Super User

What are you trying to achieve? All your if statements have the same results.. Are you not wanting to evaluate for ONLY those values? Also, the syntax of this does not work for DAX and you might want to use the SWITCH function.
https://learn.microsoft.com/en-us/dax/switch-function-dax

No they don't have the same results. I have 6-7 ID transaction2 the others can be same period Montant] * 0,75 or *0,50.... They don't have the same multiplicator. I just gave 3 examples.

This variable "prevision" becomes the Budget, so i'll need the results and multiplicate by the number of the month. To be clear: 

"if [ID transaction2]=("BLEU") then [same period Montant]*1.12" for example the result is 237 000$, so 237 000 X 1 (for month 1) the result has to be 237 000

237 000 X2 (for month 2) the result has to be 474 000

237 000 X3 (for month 3) the result has to be 711 000

Same for 

if [ID transaction2]=("BLANC") then [same period Montant]*1.2

if [ID transaction2]=("JAUJNE") then [same period Montant]*1.12.

 

After that I'll put a matrix to show for each ID transaction2 (in line), and in column for each month, showing :

1-amount of the amount for this month2,

2-cumulativ month1+month2,

3- previsions (month1 X 2 (or new name budget?).

 

EX for BLEU, for month2 (as month 1 is X1 so month2 will be clearer):

1-145 000 (I have this info)

2- 233000+145000=378 000 (I have this info)

3=474 000 (what I want to reach as formula)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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