Forum Discussion

Wresen's avatar
Wresen
Post Patron
8 months ago
Solved

Dynamic X -Axis based on Measure

Hi and thx for reading this.

I am not sure this will be able to do but i will try and see here πŸ™‚
I have a basic simple table:

 

 

 

 

 

 

 

 

I want to change the date (add 2 years to every row) and be able to put this new "Date" in an X axis for a Chart
I know that the simple way would to do this i a calculate column and do it the "normal way" but that is not what i want to do (since there will be a many of these date changes )

 

 

I want this "date change" in a measure and be able to use that measure in X -axis in a chart


Is this possible ?

Thx so much-

  • Hi Wresen 

     

    Measures themselves cannot be used as  dimensions as they don't have a filter context but they can be materialized using a column in a disconnected table which values are controlled by a measure. 

     

     

    Please see the attached sample pbix.  Otherwise,  please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.

4 Replies

  • Hi Wresen 

     

    Measures themselves cannot be used as  dimensions as they don't have a filter context but they can be materialized using a column in a disconnected table which values are controlled by a measure. 

     

     

    Please see the attached sample pbix.  Otherwise,  please provide a workable sample data (not an image), your expected result from the same sample data and your reasoning behind. You may post a link to Excel or a sanitized copy of your PBIX stored in the cloud.

  • Wresen , A measure can not change axis. 

     

    But these measures will show data for previous or future date 

     

    2 years ahead = 

    Calculate([Net], dateadd(Date[Date],2, year))

     

    2 years behind 

    Calculate([Net], dateadd(Date[Date],-2, year))

     

    Assuming you have a date table joined your fact table 

     

    Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
    https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4
    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi Wresen ,

    Thank you for providing an update and confirming that the issue has been resolved. If you require any further assistance. Please feel free to let us know, we’re happy to help!


    Thank you 
    Chaithra E.