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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors