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.
Dear all,
I have some issue build dax function:
1. I want to search the last date was held, and the condition is status is held and session type is (A or B or C)
Below is my function which show error :
1. I want to search the nearest date is scheduled, and the condition is status=schedule and session type is (A or B or C),
if there is no schedule, I want it to show "Not available“(I do not know where i should add this)
Below is my function which show error :
Solved! Go to Solution.
Last Session Date =
VAR _CComplete = "Coaching_Completion"
VAR _CSession = "Coaching_Session"
VAR _Assess = "Assessment"
VAR _calc =
IF (
Calls[date_start] = null,
"Not Available",
CALCULATE (
MAX ( Calls[date_start] ),
FILTER (
Calls,
Calls[status] = "Held"
&& Calls[type_c] = _CComplete
|| _CSession
|| _Assess
)
)
)
RETURN
_calc
Hi @xiumi_hou , try this.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Last Session Date =
VAR _CComplete = "Coaching_Completion"
VAR _CSession = "Coaching_Session"
VAR _Assess = "Assessment"
VAR _calc =
IF (
Calls[date_start] = null,
"Not Available",
CALCULATE (
MAX ( Calls[date_start] ),
FILTER (
Calls,
Calls[status] = "Held"
&& Calls[type_c] = _CComplete
|| _CSession
|| _Assess
)
)
)
RETURN
_calc
Hi @xiumi_hou , try this.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Thanks @Nathaniel_C I think it nearly reach the correct. What I really want is if the condition I put can not satisfy ,then it will show "Not available" , it is not a real blank filed. Thank you so much again。
Please see below information:
Hi @xiumi_hou ,
So are you saying, if call status <> "Held" OR if call type <> (one of your conditions), then "Not Available"
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Correct some typing error:
1. I want to search the last date was held, and the condition is status=held and session type is (A or B or C)
Below is my function which show error :
2. I want to search the nearest date is scheduled, and the condition is status=schedule and session type is (A or B or C),
and if there is no schedule date, I want it to show "Not available“(I do not know where i should add this)
Below is my function which show error :
Hi @xiumi_hou ,
Last Session Date =
CALCULATE (
MAX ( Calls[date_start] ),
FILTER ( Calls, Calls[status] = "Held" && Calls[type_c] = "A" || "B" || "C" )
)
This is written correctly, but I don't have your tables. Can you supply a PBIX file? Also what is the error message?
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Thank you so much for your reply.
Below is the exact function I put. By the way, do you know how to add "Not available" if's there's any date? Thanks!
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |