Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello Friends, can you help me on this issue
Sub Category returns the text after the last delimitor and Main Category returns the text before the last delimitor
Please provide the dax formulas for Main Category and Sub Category. See the scrren shot
Solved! Go to Solution.
@bhanu_gautam Thanks for the input, but not works.
I modified the formula as
@RENJITH_R_S , For Main Category
Main Category =
VAR CategoryText = [Category]
VAR LastDelimiterPosition = LEN(CategoryText) - FIND("~", SUBSTITUTE(CategoryText, "-", "~", LEN(CategoryText) - LEN(SUBSTITUTE(CategoryText, "-", ""))), 1)
RETURN LEFT(CategoryText, LastDelimiterPosition - 1)
Sub Category
Sub Category =
VAR CategoryText = [Category]
VAR LastDelimiterPosition = LEN(CategoryText) - FIND("~", SUBSTITUTE(CategoryText, "-", "~", LEN(CategoryText) - LEN(SUBSTITUTE(CategoryText, "-", ""))), 1)
RETURN RIGHT(CategoryText, LEN(CategoryText) - LastDelimiterPosition)
Proud to be a Super User! |
|
@bhanu_gautam Thanks for the input, but not works.
I modified the formula as
| User | Count |
|---|---|
| 50 | |
| 43 | |
| 36 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 139 | |
| 129 | |
| 61 | |
| 59 | |
| 57 |