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
DSiffredi
Employee
Employee

Measure showing blanks when changing context from days to months

Hi there, I hope someone can help here...
 
Scheduled Sales =
VAR Last Billable Date = CALCULATE(MAX(Sales[Date]) ,ALL(Sales))
RETURN
IF(SELECTEDVALUE(Date[Date]) <Last Billable Date , BLANK(),
CALCULATE([Future Sales]))
 
the DAX statement above intends to aggregate future sales when the day is bigger than the last day we have a sale registered. Calculate function on future sales works like a charm.
This DAX statement indeed works well if the context is days , but shows nothing if the context changes from days to months. What am I doing wrong that everything looks fine and works with the context of days but nothing if the context are months?
I'd expect to have the aggregation of days in a month and show that as a results instead of blanks.
 
thanks for your time
Daniel
2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@DSiffredi,

 

SELECTEDVALUE returns the value when there’s only one value in the specified column, otherwise returns the alternate result. Here BLANK is returned. You may use MAX instead.

 

Community Support Team _ Sam Zha
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

that worked like a charm Smiley Happy. Thank you so much for taking the time to help me with this!

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@DSiffredi,

 

SELECTEDVALUE returns the value when there’s only one value in the specified column, otherwise returns the alternate result. Here BLANK is returned. You may use MAX instead.

 

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

that worked like a charm Smiley Happy. Thank you so much for taking the time to help me with this!

DSiffredi
Employee
Employee

BTW: Here's a couple of screenshots showing what I meant 

 

as you can see it shows Scheduled Sales when slicing by daysas you can see it shows Scheduled Sales when slicing by daysNot showing any values or agregations when slicing by Months (FYFM in this case)Not showing any values or agregations when slicing by Months (FYFM in this case)

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.