cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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!




View solution in original post

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!




View solution in original post

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: 250 members 2,370 guests
Please welcome our newest community members: