cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 160 members 1,940 guests
Please welcome our newest community members: