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.
If the measure is blank, I need to default it to 0 when 'Details'[CreditedMonth] <= SelectedMonth.
I want the measure to always be blank when 'Details'[CreditedMonth] > SelectedMonth.
VAR SelectedMonth = SELECTEDVALUE('Date'[Month])
VAR SelectedYear = MIN('Date'[YearNum])
RETURN
CALCULATE(
COUNTX('Details','Details'[ID]),
'Date'[YearNum] = SelectedYear,
'Date'[Month] = SelectedMonth,
'Details'[CreditedMonth] <= SelectedMonth,
'Details'[Status] = "C",
ALL('Details'[Month])
)
Kind Regards
Solved! Go to Solution.
Hi @PowerbiGuRoo ,
Assume that the name of your following measure is [Measure], you can create a new measure as below to set the default values when measure is blank:
@PowerbiGuRoo wrote:@PowerbiGuRoo wrote:
VAR SelectedMonth = SELECTEDVALUE('Date'[Month])
VAR SelectedYear = MIN('Date'[YearNum])
RETURNCALCULATE(
COUNTX('Details','Details'[ID]),
'Date'[YearNum] = SelectedYear,
'Date'[Month] = SelectedMonth,
'Details'[CreditedMonth] <= SelectedMonth,
'Details'[Status] = "C",
ALL('Details'[Month])
Measure 2 =
VAR SelectedMonth =
SELECTEDVALUE ( 'Date'[Month] )
RETURN
IF (
ISBLANK ( [Measure] ),
IF ( MAX ( 'Details'[CreditedMonth] ) <= SelectedMonth, 0, BLANK () ),
[Measure]
)
Best Regards
Rena
@PowerbiGuRoo , Try like
A=
CALCULATE(
COUNTX('Details','Details'[ID]),
'Date'[YearNum] = SelectedYear,
'Date'[Month] = SelectedMonth,
'Details'[CreditedMonth] <= SelectedMonth,
'Details'[Status] = "C",
ALL('Details'[Month])
) +0
B =CALCULATE(
COUNTX('Details','Details'[ID]),
'Date'[YearNum] = SelectedYear,
'Date'[Month] = SelectedMonth,
'Details'[CreditedMonth] > SelectedMonth,
'Details'[Status] = "C",
ALL('Details'[Month])
)
C= A+B
Hello,
Thank you for your response. I did not articulate myself 100%.
If the measure is blank, I need to default it to 0 when 'Details'[CreditedMonth] <= SelectedMonth.
When 'Details'[CreditedMonth] > SelectedMonth, I want the measure to always be blank.
Kind Regards
Hi @PowerbiGuRoo ,
Assume that the name of your following measure is [Measure], you can create a new measure as below to set the default values when measure is blank:
@PowerbiGuRoo wrote:@PowerbiGuRoo wrote:
VAR SelectedMonth = SELECTEDVALUE('Date'[Month])
VAR SelectedYear = MIN('Date'[YearNum])
RETURNCALCULATE(
COUNTX('Details','Details'[ID]),
'Date'[YearNum] = SelectedYear,
'Date'[Month] = SelectedMonth,
'Details'[CreditedMonth] <= SelectedMonth,
'Details'[Status] = "C",
ALL('Details'[Month])
Measure 2 =
VAR SelectedMonth =
SELECTEDVALUE ( 'Date'[Month] )
RETURN
IF (
ISBLANK ( [Measure] ),
IF ( MAX ( 'Details'[CreditedMonth] ) <= SelectedMonth, 0, BLANK () ),
[Measure]
)
Best Regards
Rena
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |