Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I have a table named srs_cap with columns that contain decision information (cap_dec1, cap_dec2, cap_dec3) and the corresponding dates when those decisions were made (cap_decd, cap_dcd2, cap_dcd3).
The logic is as follows: Identify the most recent decision date from cap_decd, cap_dcd2, and cap_dcd3 that is on or before same date last year. If the corresponding decision (cap_dec1, cap_dec2, or cap_dec3) has the value 'C', then count the entries in cap_stuc.
i am using the below two measure one to check occurrence of C and second one to check U
| cap_stuc | cap_dec1 | cap_decd | cap_dec2 | cap_dcd2 | cap_dec3 | cap_dcd3 | Correct output | Conditional_Count | UnConditional_Count |
| 80171 | C | 01/08/2023 00:00 | U | 17/01/2024 00:00 | Conditional | 1 | 0 | ||
| 80335 | C | 28/11/2023 00:00 | U | 09/01/2024 00:00 | 1 | 1 | |||
| 103278 | 0 | 0 | |||||||
| 132353 | C | 14/06/2023 00:00 | Conditional | 1 | 0 | ||||
| 160112 | C | 09/01/2024 00:00 | U | 18/01/2024 00:00 | 1 | 1 | |||
| 173991 | C | 01/08/2023 00:00 | U | 24/11/2023 00:00 | Conditional | 1 | 0 | ||
| 190815 | 0 | 0 | |||||||
| 191899 | R | 07/11/2023 00:00 | 0 | 0 | |||||
| 191925 | C | 13/09/2023 00:00 | U | 17/01/2024 00:00 | Conditional | 1 | 0 | ||
| 190740 | C | 12/01/2023 00:00 | Conditional | 1 | 0 | ||||
| 19088 | R | 13/09/2023 00:00 | 0 | 0 | |||||
| 200052 | 0 | 0 | |||||||
| 200169 | 0 | 0 | |||||||
| 200269 | C | 21/09/2023 00:00 | U | 17/01/2024 00:00 | Conditional | 1 | 0 | ||
| 200284 | C | 11/05/2023 00:00 | Conditional | 1 | 0 | ||||
| 200301 | C | 01/08/2023 00:00 | U | 18/12/2023 00:00 | Conditional | 1 | 0 | ||
| 200347 | C | 11/05/2023 00:00 | U | 17/11/2023 00:00 | Conditional | 1 | 0 | ||
| 210582 | C | 13/09/2023 00:00 | U | 14/09/2023 00:00 | Unconditional | 0 | 1 | ||
| 220366 | R | 04/08/2023 00:00 | 0 | 0 | |||||
| 220371 | C | 14/06/2023 00:00 | U | 25/07/2023 00:00 | Unconditional | 0 | 1 |
Solved! Go to Solution.
@gautampruthi No idea where the 9 comes from. Likely, you should unpivot those three columns to make the calculation easier. Otherwise, you could use something like MC Aggregations: Multi-Column Aggregations (MC Aggregations) - Microsoft Fabric Community
i managed to get the desired output by changing the measure as
Hi,@gautampruthi
We are delighted that you have found a solution and are willing to share it.
Accepting your post as the solution is incredibly helpful to our community, as it enables members with similar issues to find answers more quickly.
Thank you for your valuable contribution to the community, and we wish you all the best in your work.
Best Regards,
Leroy Lu
Hi @Greg_Deckler Thank you for looking into this.
i have added more information along with the measure i am using and output i am getting.
@gautampruthi No idea where the 9 comes from. Likely, you should unpivot those three columns to make the calculation easier. Otherwise, you could use something like MC Aggregations: Multi-Column Aggregations (MC Aggregations) - Microsoft Fabric Community
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 73 | |
| 70 | |
| 39 | |
| 34 | |
| 23 |