Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
DineshDwilco
Frequent Visitor

Split method in USERNAME() - Directquery

Hi all,

    in my mvc c# application i will pass USERNAME() as "Username | ID" in DirectQuery. How will split i need to set both condition in my Power BI Dashboard, 

    is this possible ?

 

Regards

Dinesh D

1 ACCEPTED SOLUTION

Hi @DineshDwilco ,

 

Yes, you are right. SEARCH/FIND and LEFT/RIGHT/MID are not supported with DirectQuery, but only when you want to create column. It still works in measure.

vchenwuzmsft_0-1637200070455.png

 

Another way to split ID is edit data in power query editor, but the only ID in your case.

vchenwuzmsft_1-1637200175707.png

If length of your ID is fixed, please try to use add a new column via 

 

Text.End([username&ID],3) // The 3 is the length of ID

 

But if the type of the username&ID is char this won't work.

Then go to the power bi report page, use measure like above to get the username.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@DineshDwilco Use PATHITEM in a measure? Alternatives would be using LEFT and RIGHT in coordination with SEARCH/FIND. Not exactly sure of the scenario.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

PATHITEM does not supports in DirectQuery. so i will find suitable 

@DineshDwilco OK, then you will need to use SEARCH/FIND and LEFT/RIGHT/MID



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I checked with MS Document  SEARCH/FIND and LEFT/RIGHT/MID are not supported with DirectQuery.

Hi @DineshDwilco ,

 

Yes, you are right. SEARCH/FIND and LEFT/RIGHT/MID are not supported with DirectQuery, but only when you want to create column. It still works in measure.

vchenwuzmsft_0-1637200070455.png

 

Another way to split ID is edit data in power query editor, but the only ID in your case.

vchenwuzmsft_1-1637200175707.png

If length of your ID is fixed, please try to use add a new column via 

 

Text.End([username&ID],3) // The 3 is the length of ID

 

But if the type of the username&ID is char this won't work.

Then go to the power bi report page, use measure like above to get the username.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors