Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Kindly, if you could help me add an if statement in below VAR,
If the statement is like this: if (AssetMaintenanceRequests[Month]) = "JAN," then VAR (as below)
Regard,,
Solved! Go to Solution.
Hi @assemomar,
Please try if this solve your problem:
Proud to be a Super User!
Hi @assemomar ,
Your solution is great, @_AAndrade . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.
I think we can use the IF function to check if the Color variable (which holds the month from AssetMaintenanceRequests[Month]) equals "JAN". If it does, we proceed with your original calculation to determine CarModel. If not, the function returns BLANK(), meaning no value will be returned for months other than January.
Here is the DAX I will provide.
VolumeJAN =
VAR Color = AssetMaintenanceRequests[Month]
RETURN
IF (
Color = "JAN",
VAR CarModel =
CALCULATE (
MAX ( 'VOLUME-JAN'[volume] ),
AssetMaintenanceRequests[Month] = Color
)
RETURN
CarModel,
BLANK ()
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @assemomar ,
Your solution is great, @_AAndrade . It worked like a charm! Here I have another idea in mind, and I would like to share it for reference.
I think we can use the IF function to check if the Color variable (which holds the month from AssetMaintenanceRequests[Month]) equals "JAN". If it does, we proceed with your original calculation to determine CarModel. If not, the function returns BLANK(), meaning no value will be returned for months other than January.
Here is the DAX I will provide.
VolumeJAN =
VAR Color = AssetMaintenanceRequests[Month]
RETURN
IF (
Color = "JAN",
VAR CarModel =
CALCULATE (
MAX ( 'VOLUME-JAN'[volume] ),
AssetMaintenanceRequests[Month] = Color
)
RETURN
CarModel,
BLANK ()
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @assemomar,
Please try if this solve your problem:
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
88 | |
85 | |
68 | |
66 | |
64 |
User | Count |
---|---|
209 | |
118 | |
116 | |
81 | |
74 |