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
hemingt
Helper V
Helper V

How to set the value of measure to null if the X-axis Week value greater than current Week

Hello,

I have a line chart to show a measure Actual.

the measure, which main purpose is to count the rows by considering some filters.

If the x-axis Week number is less than or equal to current week, the measure should set to the really count number.

if the x-axis week number is greater than current week, the measure should set to null, so that the line would not show on the chart.

 

for an example as below chart, I do not want to show the Actual line after X-axis 1914. Is there any solution? Thank you!

 

360-518036515.jpg

1 ACCEPTED SOLUTION

Hi @hemingt ,

 

One sample for your reference. We can create a meausure as below to get the excepted result we need. If it doesn't meet your requirement, kindly share your sample data to me via uploading files to One Drive then share the link here.

 

less than or equal today = var weektoday = WEEKNUM(TODAY())
return
IF(weektoday<=MAX('Table'[Week]),BLANK(),COUNTROWS('Table'))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
hemingt
Helper V
Helper V

Is there any suggestion? Thank you!

Hi @hemingt ,

 

One sample for your reference. We can create a meausure as below to get the excepted result we need. If it doesn't meet your requirement, kindly share your sample data to me via uploading files to One Drive then share the link here.

 

less than or equal today = var weektoday = WEEKNUM(TODAY())
return
IF(weektoday<=MAX('Table'[Week]),BLANK(),COUNTROWS('Table'))

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

thank you @v-frfei-msft , it works well.

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.