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

Measure Value convert to Text

Hi,

 

i have a trivial question but i dont can solve this issue Smiley LOL .

So i have this Measure, a static string/text "2018", get the result and works fine. 😉

1.png

1.2.PNG

But now i want to replace the static stuff to dynamic measure "LastYear" and get this issue:

2.png

 

1.1.PNG

2.1.PNG

 

When i show both Measure "LastYear and ActualYear" in a card, table,.. then it show me the correct result "2018" & "2019"

 

I hope you can help me and thanks in advance

 

Kind regards,

Unknown

 

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@Anonymous - 

Try it with a variable instead of a measure.

Variables can be loaded with a value and that value can then be used.

Measures are evaluated at the point in which they are used. So in your measure, there is probably something else affecting it.

 

General variable usage:

 

Previous Year = 
var my_variable = max('Date'[Year])
return my_variable - 1

Cheers!

Nathan

View solution in original post

Hi @Anonymous 

It looks like you are using the simplified syntax for the filter parmeters in the CALCULATE where it is not allowed. 

Instead of

CALCULATE(SUM( ...); Table1[Geschäftsjahr] = [LastYear])

try

CALCULATE( SUM( ...);

                    FILTER( ALL(Table1[Gefächstjahr]); Table1[Geschäftsjahr] = [LastYear]) )

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anonymous - 

Try it with a variable instead of a measure.

Variables can be loaded with a value and that value can then be used.

Measures are evaluated at the point in which they are used. So in your measure, there is probably something else affecting it.

 

General variable usage:

 

Previous Year = 
var my_variable = max('Date'[Year])
return my_variable - 1

Cheers!

Nathan

Hi @Anonymous 

It looks like you are using the simplified syntax for the filter parmeters in the CALCULATE where it is not allowed. 

Instead of

CALCULATE(SUM( ...); Table1[Geschäftsjahr] = [LastYear])

try

CALCULATE( SUM( ...);

                    FILTER( ALL(Table1[Gefächstjahr]); Table1[Geschäftsjahr] = [LastYear]) )

 

Anonymous
Not applicable

@AlB  & @Anonymous  Thanks, both approach works. 🙂 🙂

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.