Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Dynamic X-Axis Chart based on Parameter

Hi 

 

I am from tableau world and need to know more about PowerBI. I am trying to reflect my tableau dashboard in Power BI. 

I have a parameter with values 'YTD','MTD','Previous YTD','Previous MTD','Previous Month','Previous Year','Year-over-year'. In tableau the date values changes in x-axis based on parameter input. Yaxis would display sales and profit. 

 

I tried using below DAX as mesure as well as column. Both resulter in the displayed warning and it didn't work.

 

upload.PNG

 

Still lot more else statments to be written for YTD, PYTD,etc. But here itself I am facing issue. Also I am not sure why I need to use MAX(Paramter Value). If I use Query2[Analysis Selection], then I get an error in DAX "Cannot find name [Analysis Selection]'.

upload.PNG

 

If I create a seperate tableau I had to inter relate the tables. Is this the way power BI works?

 

Similarly is there a way to pull a "Any" type Date paramter into slicer/visual and make the dax calculation and visuals react based on single date provided as input instead of choosing edit queries -> edit paramter?

 

 

 

1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

You can't use DATESBETEEN as a value for a measure (or a calculated column) since measures return only SCALARS, not tables. Only in one case are you authorized to assign a table to a measure value - when the table holds only one column and one row. In this case DAX turns the table into a value automatically. Also, I'd kindly suggest that you learn about time-intelligence in Power BI because I can see you're doing it incorrectly, which means sooner or later you'll have mistakes/bugs in your figures.

 

You can start here: https://www.sqlbi.com/articles/time-intelligence-in-power-bi-desktop/

and then head over to: https://docs.microsoft.com/en-us/power-bi/guidance/star-schema

 

Please learn the philosophy of Power BI and how DAX works to avoid common mistakes.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.