Forum Discussion
Iyke4joe
6 years agoFrequent Visitor
DAX Help
Please I need help converting the SQL Code below to Power BI DAX. a and b aliases are for different tables respectively. Thank you. (((COUNT(a.[Case ID])*365/MAX(b.[Days in Month])))/(MAX(b.Membe...
Iyke4joe
6 years agoFrequent Visitor
Hi Greg, thank you for your response. For the sake of security, I can't give the exact data but here's a typical representation of it.
Thank you in anticipation of your response.
Table A | |||
CaseID | MemberID | SaleDays | Date |
234 | cc1 | 4 | 3/6/2019 |
456 | cc2 | 3 | 4/12/2019 |
789 | cc3 | 9 | 5/19/2019 |
Table B | ||||
Member_id | Membership | Year | Month | Days in Month |
cc1 | 2 | 2019 | 3 | 3 |
cc2 | 3 | 2019 | 4 | 30 |
cc3 | 5 | 2019 | 5 | 31 |
cc4 | 9 | 2019 | 7 | 31 |
cc5 | 7 | 2019 | 8 | 31 |
Greg_Deckler
6 years agoCommunity Champion
Iyke4joe - Yep, understood, sample data is great. And what is the expected output from the sample data you provided? Once I understand that, should be able to mock this up in a PBIX for you.
- Iyke4joe6 years agoFrequent Visitor
Here's the explanation I got for the code. Will this help?
Metric Membership Days in Year Days in Month Formula Comment Solution/ K 315 12821 365 31 =(A2*C2/D2)/(B2/1000) (metric * Days in Year/Days in Month)/(Membership/1000) ; Goes down to days and helps in Feb since it has fewer days 289.28