Forum Discussion
jambopriti
1 year agoHelper I
Need 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
Anonymous
1 year agoNot applicable
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
1 year agoHelper I
Hello, Thank you.
I'm getting the below errors. Please guide. Thanks.
- Anonymous1 year agoNot applicable
Hello jambopriti ,
Could you please share the sample PBIX file with us?
Additionally, kindly let us know the specific context in which you are encountering the errors. Are the errors occurring when you drag the measures onto a visual, or are they present within the measures themselves?
Your clarification will help us assist you more effectively.
Regards,
B Manikanteswara Reddy