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.
I have a data table (see the attached) , I am trying to get a calculated column based on some condition
Condition( if all FeeType is Hourly for a particular project then for that project the result will be Hourly, if all is NoBilling then NoBilling else Fixed) but I am not getting the result.
Solved! Go to Solution.
Hi @arifulice09 ,
Create a column like this:-
Column_ =
var _hourly = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "Hourly" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
var _nobill = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "NoBilling" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
var _proj = COUNTROWS(FILTER('Table (3)','Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
return SWITCH(TRUE(),
_hourly = _proj ,"Hourly",
_nobill = _proj,"No Biling",
"Fixed")
Output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @arifulice09 ,
Create a column like this:-
Column_ =
var _hourly = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "Hourly" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
var _nobill = COUNTROWS(FILTER('Table (3)','Table (3)'[Feetype] = "NoBilling" && 'Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
var _proj = COUNTROWS(FILTER('Table (3)','Table (3)'[projectid] = EARLIER('Table (3)'[projectid])))
return SWITCH(TRUE(),
_hourly = _proj ,"Hourly",
_nobill = _proj,"No Biling",
"Fixed")
Output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hello there @arifulice09 ! Check if this works for you:
Desired Result =
SWITCH (
TRUE (),
DISTINCTCOUNT ( 'Table'[Feetype] ) > 1, "Fixed",
SELECTEDVALUE ( 'Table'[Feetype] )
)
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
Thanks!
You can also check out my LinkedIn!
Best regards,
Gonçalo Geraldes
@goncalogeraldes Thanks for your reply, using the above code only giving the result of "Fixed" value.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
91 | |
82 | |
62 | |
62 | |
58 |
User | Count |
---|---|
159 | |
114 | |
100 | |
75 | |
65 |