cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
alihijazi Regular Visitor
Regular Visitor

parameters

Hello I'm new to powerBI

Is there a way to create a variable or parameter like vMaxYear = year(max(TrxDate)) and then use this parameter or variable in the filter of a calculate Dax expression?

2 REPLIES 2
Super User
Super User

Re: parameters

So the answer is probably yes, but would need more specifics.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Moderator Eric_Zhang
Moderator

Re: parameters

@alihijazi

You could declare a variable as below

LatestYearSumTotal = 
VAR MaxYear = YEAR(max(Orders[OrderDate]))
RETURN
CALCULATE(
SUM(Orders[Freight]),FILTER(Orders,YEAR('Orders'[OrderDate])=MaxYear))

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 54 members 1,187 guests
Please welcome our newest community members: