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.
This is what I want to say:
"How many Administrative are Men?"
This is my DAX:
Solved! Go to Solution.
Sorry to be confusing. VAR1 & VAR2 are just ideas that represent 2 different variables.
You can call them whatever you want.
- VAR1 contains your original CALCULATE statement (but only 1 time).
- VAR2 contains IF logic that checks to see if VAR1 is blank.
- IF VAR1 is blank THEN return 0 ELSE return VAR1.
Please try the following.
Place your measure inside of VAR1.
Then create a second VAR2 that checks if VAR1 is blank, and returns 0 if it's blank.
Something like the following.
Hope this is helpful to you.
Regards,
Nathan
P.S. Although it is possible to go the route you wrote it, it is not recommended. Both for performance & readability, any time you repeat the same code multiple times within the same measure, it is best practice to place that code inside a VAR. (In the code below, the exact same CALCULATE appears twice.)
Hey,
I am not sure what "Result" should be in VAR2
Sorry to be confusing. VAR1 & VAR2 are just ideas that represent 2 different variables.
You can call them whatever you want.
- VAR1 contains your original CALCULATE statement (but only 1 time).
- VAR2 contains IF logic that checks to see if VAR1 is blank.
- IF VAR1 is blank THEN return 0 ELSE return VAR1.
No, you're not confusing, I just don't know what I'm doing. I just started using this service.
However, your advice worked so I am very appreciative to you. Thank you so much!
User | Count |
---|---|
69 | |
43 | |
21 | |
21 | |
14 |
User | Count |
---|---|
124 | |
41 | |
39 | |
28 | |
24 |