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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

X-axis display all dates in Calendar table

Hello all,

 

I'm quite new in Power BI, and I can't figure out something about my Calendar Table.

I have created a dimension table for the dates, it ranges from 2010 to 2030, as I don't want to update it too soon. I made the relationship with my "Sales" tables.

 

In a "Line and Clustered column chart", when I add a "Count" column, and an "Average" line based of some fields, along the date x axis from the Dimension tables, everything is fine, I just see the dates of the data (it is actually just 12 month of data), so it ranges over 2019-2020.

 

But when I add another line called "Target" which is a measure equal to 90 (90%), therefore independant of any date, the chart displays all dates on the x-axis, from 2010 to 2030, which I kind of understand.

 

How could I prevent the "Target" line from expanding the date axis ? Only by a formula in the "Target" Measure?

 

Thanks a lot for your help

 

1 ACCEPTED SOLUTION

@Anonymous change target to this

 

Target = 
90 * DIVIDE ( [count measure], [count measure] )

 

assuming your count measures is as below or it can be any measure that you are showing in your visual

 

Count Measure = COUNTROWS ( Table )

 

I would ❤Kudos 🙂 if my solution helped. ?

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

7 REPLIES 7
Pragati11
Super User
Super User

HI @Anonymous ,

 

It will be nice to have the calculation for your TARGET measure. You can add a filter in your measure calculation to calculate only till the maximum date in your data.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

parry2k
Super User
Super User

@Anonymous can you share the DAX expression of Target measure.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Just  Target = 90

so that would make a horizontal line on the graph.

 

I'm trying to use a IF with returning FALSE(), but the dates are still there.

HI @Anonymous ,

 

You can also do one thing.

On your line chart visual, you can apply a filter for MAX(DateValue) which is in your data.

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

@Anonymous change target to this

 

Target = 
90 * DIVIDE ( [count measure], [count measure] )

 

assuming your count measures is as below or it can be any measure that you are showing in your visual

 

Count Measure = COUNTROWS ( Table )

 

I would ❤Kudos 🙂 if my solution helped. ?

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

That did the trick, thanks a lot !

Hi @Anonymous ,

 

Just wanted to check if MAX(Date Value) filter on visual worked or not?

If yes, can you mark this also solution?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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