Forum Discussion
jambopriti
Helper I
1 year agoNeed Help in the Calculation - If-Then_Else or alternatives
Hi, I have the below request (testdata) is included. Please guide. Thanks. I have these requirements and need to create the visual like below. Please guide. Thank you. Calculate the Readmits: G...
- Anonymous1 year ago
Hi jambopriti ,
Thank you for reaching out to Microsoft Fabric Community Forum.
Please use the following DAX measures.
Total Records(Readmits) = COUNTROWS('ReAdmit DATA')Readmit 0-30 =CALCULATE(COUNTROWS('ReAdmit DATA'),'ReAdmit DATA'[same_level] = "Yes",'ReAdmit DATA'[Days] >= 0,'ReAdmit DATA'[Days] <= 30)Readmit 31-60 =if(ISBLANK(CALCULATE(COUNTROWS('ReAdmit DATA'),'ReAdmit DATA'[same_level] = "Yes",'ReAdmit DATA'[Days] > 30,'ReAdmit DATA'[Days] <= 60)),0,cALCULATE(COUNTROWS('ReAdmit DATA'),'ReAdmit DATA'[same_level] = "Yes",'ReAdmit DATA'[Days] > 30,'ReAdmit DATA'[Days] <= 60))Readmit 61-90 =CALCULATE(COUNTROWS('ReAdmit DATA'),'ReAdmit DATA'[same_level] = "Yes",'ReAdmit DATA'[Days] > 60,'ReAdmit DATA'[Days] <= 90)Readmit 91-365 =CALCULATE(COUNTROWS('ReAdmit DATA'),'ReAdmit DATA'[same_level] = "Yes",'ReAdmit DATA'[Days] > 90,'ReAdmit DATA'[Days] <= 365)Percent 0-30 = DIVIDE([Readmit 0-30], Total Records(Readmits))
Percent 31-60 = DIVIDE([Readmit 31-60], Total Records(Readmits))Percent 61-90 = DIVIDE([Readmit 61-90], Total Records(Readmits))Percent 91-365 = DIVIDE([Readmit 91-365], Total Records(Readmits))If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
B Manikanteswara Reddy
jambopriti
Helper I
1 year agoThank you. I had a twik my table and column data type. it is working now.
Thank you for your help!! I'll mark this one as solved. Thanks again.