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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sportive92003
Frequent Visitor

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.

Top Solution Authors