cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jporter Helper I
Helper I

Switch If and Else to compare multiple months

Hello,

 

I am trying to use if or switch logic to complete the folllowing. I work for a collections call center and customers will roll throught these things we call buckets if they become delinquent or they will "cure" if they pay off the loan.

 

I created quick measures to compare each year to the previous. However, the method I chose to use is creating a new column and creating duplicate customers (loan_num) for march (I circled an example in blue).

 

I want to be able to compare there statuses for the three months without March creating a new row, which is causing what I wrote below to be innacurate. 

 

Any takers on what I can do to improve this logic?

 

Question 2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Switch If and Else to compare multiple months

Hi @Jporter 

 

You can create measures "collected" and "cure".

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

7 REPLIES 7
Super User IV
Super User IV

Re: Switch If and Else to compare multiple months

Hi   @Jporter

 

Sorry if I miss understood your requirement, but the extra row is introduced by adding CCR to your Table visual, so once removed it will not add an extra row.


Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

 

Community Support
Community Support

Re: Switch If and Else to compare multiple months

Hi @Jporter ,

 

Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Jporter Helper I
Helper I

Re: Switch If and Else to compare multiple months

Hello,

 

Yup that was what it was. That new column is creating duplicates. Unfortunatly, I need the calculations for the next visual so that we can see how many loans "collected", "cure", or remained delinquent. Do you have any suggestions on the best way to do this?

 

Thanks for taking a look at this! I have been working on this for a week!

Super User IV
Super User IV

Re: Switch If and Else to compare multiple months

Hi @Jporter 

 

You can create measures "collected" and "cure".

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

Highlighted
Jporter Helper I
Helper I

Re: Switch If and Else to compare multiple months

Ahh okay! SO seperate my logic out into two measure. That makes sense! Let me try that and I will mark your response as the answer!

 

Thank you!!!

Jporter Helper I
Helper I

Re: Switch If and Else to compare multiple months

Hi I am back to this and now I cannot get the measures to show in a visual. Is it because they are a string?

 

collect = SWITCH (TRUE(),
AND([status for February 2020] = 3, [status for March 2020] = 2), "collect",
AND([status for February 2020] = 2, [status for March 2020] = 1), "collect",
" "
)

 

cure = SWITCH (TRUE(),
AND([status for February 2020] = 1, [status for March 2020] = 0), "cure",
AND([status for February 2020] = 2, [status for March 2020] = 0), "cure",
AND([status for February 2020] = 3, [status for March 2020] = 0), "cure",
"roll"
)


stab = SWITCH (TRUE(),
AND([status for February 2020] = 1, [status for March 2020] = 1), "stab",
AND([status for February 2020] = 2, [status for March 2020] = 2), "stab",
AND([status for February 2020] = 3, [status for March 2020] = 3), "stab",
" "
)

 

I want to see how many of them for the month of each. They keep moving to tooltips.  Hopefully that makes sense.

Jporter Helper I
Helper I

Re: Switch If and Else to compare multiple months

Figured it out!

 

CollectCSUM =
SUMX(
'Roll Rates',
SWITCH (
TRUE(),
AND([status for February 2020] = 3, [status for March 2020] = 2), 1,
AND([status for February 2020] = 2, [status for March 2020] = 1), 1,
0
)
)


stabSUM =
SUMX(
'Roll Rates',
SWITCH (
TRUE(),
AND([status for February 2020] = 1, [status for March 2020] = 1), 1,
AND([status for February 2020] = 2, [status for March 2020] = 2), 1,
AND([status for February 2020] = 3, [status for March 2020] = 3), 1,
0
))


CureSUM =
SUMX(
'Roll Rates',
SWITCH (TRUE(),
AND([status for February 2020] = 1, [status for March 2020] = 0), 1,
AND([status for February 2020] = 2, [status for March 2020] = 0), 1,
AND([status for February 2020] = 3, [status for March 2020] = 0), 1,
0
)

)

RollSUM =
SUMX(
'Roll Rates',
SWITCH (TRUE(),
AND([status for February 2020] = 1, [status for March 2020] = 2), 1,
AND([status for February 2020] = 2, [status for March 2020] = 3), 1,
AND([status for February 2020] = 3, [status for March 2020] = 4), 1,
0
)

)

 

except they run super slow. There are about 22 million rows of data.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors