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
Anonymous
Not applicable

Measures Issue

Hi team,

 

I want a help in the measure formula..

Yachika_0-1600412560522.png

If I am selecting Currency Euro, then prev spend in sterling should return the value prevspend/1.3, but it is not getting the exact value when spend is null..

Formula of prev spend is 

PREVSPEND = if(areaSummary[Datediff]<=365,(CALCULATE([TOTALSPEND2],SAMEPERIODLASTYEAR(Dates[Date]))),blank())
Previous Spend in Sterling = IF(areaSummary[Currency]=2,[PREVSPEND]/1.3,[PREVSPEND])
Currency here is calculated from a currencyID column as Currency= MAX(areasummary[currencyid])
 
Can anyone help me ?

 

8 REPLIES 8
amitchandak
Super User
Super User

@Anonymous ,

 

Better you should have a column liek
Spend con = if(areaSummary[Currency]=2, [Spend]/1.3 ,[Spend] ) //assuming spend is the column in table

 

in the measure it should work like
Previous Spend in Sterling = IF(max(areaSummary[Currency])=2,[PREVSPEND]/1.3,[PREVSPEND]) //but it will depedent on row context

Anonymous
Not applicable

@amitchandak 

 

Spend is measure here and that is working fine...Issue is in the prev spend in sterling measure..

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Anonymous
Not applicable

The main issue is it is working on else statement always when the spend value in not there for prev spend..

Anonymous
Not applicable

Anonymous
Not applicable

@amitchandak  any suggestions ?

@Anonymous , The visual is not loading

Anonymous
Not applicable

@amitchandak  not able to attach a file here as there is no option...How can I showcase you?

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.