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
Anonymous
Not applicable

Slicer not filtering measure with constant value over date range

Hello,

 

I have a line chart with a Date as an axis and two measures for the values. One of the measures has formula "Ideal= 1" showing a horizontal line going through 1. The issue is that when I slice the date for a time interval, this measure "Ideal " is not sliced to show only the date interval. The first 2 images are the whole date range, the last 2 pictures are with the filter applied for November-December 2019. The "Ideal" line shows for the whole of 2019 when it shouldn't. Any thoughts?

image.pngimage.pngimage.pngimage.png

1 ACCEPTED SOLUTION

Hi @Anonymous ,

You can try a measure similar to the following:

Ideal = IF(SUM(financials[ Sales])=BLANK(),BLANK(),1)

Or you can use constant line in Analytics:

1.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EUr8hleS3_JMsmaKgutMir4BmyhDusDJnQ-0i_Y9l9I2ZA?e=hgtd4l

Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous how does your measure looks like?



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

The measure is exactly :

Ideal = 1

Hi @Anonymous ,

You can try a measure similar to the following:

Ideal = IF(SUM(financials[ Sales])=BLANK(),BLANK(),1)

Or you can use constant line in Analytics:

1.PNG

Here is a demo, please try it:

https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EUr8hleS3_JMsmaKgutMir4BmyhDusDJnQ-0i_Y9l9I2ZA?e=hgtd4l

Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Anonymous so if your measure is value = 1 then it is going to show for all the month regardless how you filter it because your measure is always returning a value

 

 



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

I'm with a similar problem.

Can you guys take a little look?

Link: https://community.powerbi.com/t5/Desktop/DIVIDE-DAX-with-error-when-using-2-numerators/m-p/1933428

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.