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
thighland
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
MFelix
Super User
Super User

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

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

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

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



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.