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
JesseV
Frequent Visitor

measure that returns another column value based on the current month

I'm looking for a measure that returns the % based on the current month from the following table:

 

 

Datum (Date type)Verwachte voortgang (% type)
Jan 9%
Feb 18%
Mar 28%
Apr35%
May45%
Jun55%

 

So currently I would want the measure to return 55%.

 

I attempted this, but it gives error that it cannot return a single output

 

 

 

Verwachtte vooruitgang = 
SELECTEDVALUE('Voortgang %'[Verwachte voortgang],
FILTER ('Voortgang %'[Datum],'Voortgang %'[Datum].[Maand] = MONTH(TODAY())
))

 

 

1 ACCEPTED SOLUTION
JesseV
Frequent Visitor

I ended up cracking it by adding Calculate before the whole thing:

Verwachtte vooruitgang = 
CALCULATE(SELECTEDVALUE('Voortgang %'[Verwachte voortgang]),
    Filter('Voortgang %','Voortgang %'[Maand] = MONTH(TODAY()))
)

 
Thanks a ton for your assistance @onurbmiguel_ 

View solution in original post

8 REPLIES 8
JesseV
Frequent Visitor

JesseV_0-1654607895778.png

Naturally, it's a manually added table (where Maand is the month number and date the first day of the month date value) 

Hi again

 

Verwachtte vooruitgang = 
SELECTEDVALUE(
	'Voortgang %'[Verwachte voortgang],
	FILTER(
		ALL('Voortgang %'),
		'Voortgang %'[Maand]= MONTH(TODAY())
	)
)

 

Need to be careful because if you have more than 2 year it will return a error.

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! ;-
Best Regards
BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


if you have 2 or more year you can try: 

 

Verwachtte vooruitgang = 
SELECTEDVALUE(
	'Voortgang %'[Verwachte voortgang],
	FILTER(
		ALL('Voortgang %'),
		'Voortgang %'[Datum] = date( year(TODAY()) , MONTH(TODAY()) , 1 )
	)
)

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! ;-
Best Regards
BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Hey Onurbmiguel,

I appreciate the effort! Unfortunately I'm still getting the same error

JesseV_0-1654612281793.png

I attempted to filter on the Month value (outside of the date column) , this had the same error as a result. (It's complaining about multible collumns not being converted, only a scalair value can be (whatever that may be). 

 

I'm starting to think my approach to using SELECTEDVALUE is wrong (after reading https://docs.microsoft.com/en-gb/dax/selectedvalue-function ) 

Since I don't want to filter on the 'Voortgang %'[Verwachte voortgang] collumn but on the Month collumn. 

 

As in the example; every month will have 1 row with only 1 value. 

JesseV
Frequent Visitor

I ended up cracking it by adding Calculate before the whole thing:

Verwachtte vooruitgang = 
CALCULATE(SELECTEDVALUE('Voortgang %'[Verwachte voortgang]),
    Filter('Voortgang %','Voortgang %'[Maand] = MONTH(TODAY()))
)

 
Thanks a ton for your assistance @onurbmiguel_ 

onurbmiguel_
Super User
Super User

Hello Jesse 

Try like this 

 

Verwachtte vooruitgang = 
SELECTEDVALUE('Voortgang %'[Verwachte voortgang],
FILTER (ALL('Voortgang %'),'Voortgang %'[Datum].[Maand] = MONTH(TODAY())
))

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! ;-
Best Regards
BC

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Hey @onurbmiguel_ , thank you for replying.

 

The measure gives an error: 'The expression references multiple columns. Multiple collumns cannot be converted to a scalair value' (attempted translation on my part ;))

 

is this because the 'Verwachte voortgang' collumn has multiple %-ages ?

Hi again Jesse, 

You can share some values ​​from the table to see the structure of the model, and if you are using a calendar table.

 

BR 

Bruno

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


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.