cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thighland Frequent Visitor
Frequent Visitor

Filtering data with DAX

Hello all,

I'm new to DAX and struggling with writing some of the formulas for my data.  My current dataset has a fact table ("Actuals") which houses revenue data for all locations for fiscal years 2015, 2016, and 2017.  I'm trying to build a visual that will show a line chart with 2015 revenue for each month (as one line), and also same thing for 2016 (as another line), and for 2017 (as another line), so i can compare revenue trends across the months for the three years.

 

I'm guessing I need to create a measure for each year, filtering the table for that year, but I'm clearly missing something.

 

2015 Revenues = CALCULATE(
	SUM(Actuals[Revenues]),
	Actuals[FY] = "2017"
)

It's giving an error "DAX comparison operations do not support comparing values of type integer with values of type Text...".  The Revenues column is a fixed decimal data type and the FY column is a whole number.

 

 

What did I miss here?  And am I even on the right track to build the visual I want?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Filtering data with DAX

Hi @thighland,

Taking into account that the FY column is year that must be format as number so you kust need to put in Actuals[FY]=2017 dom't put the quotation mark.

However I believe that would be easier to add the FY column to the legend in the line graph and you will have the 3 lines as you want.

Regards,
MFelix


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

Proud to be a Datanaut!




1 REPLY 1
Super User
Super User

Re: Filtering data with DAX

Hi @thighland,

Taking into account that the FY column is year that must be format as number so you kust need to put in Actuals[FY]=2017 dom't put the quotation mark.

However I believe that would be easier to add the FY column to the legend in the line graph and you will have the 3 lines as you want.

Regards,
MFelix


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

Proud to be a Datanaut!




Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

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

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 135 members 1,768 guests