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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Switching data sources and swith(true) selected value measure

Dear PBI folk,

 

I have used I switch(true) formula and a expence mapping table to create a expence table from general ledger data.

I needed to change the data source of the expence mapping table from sharepoint excel file, to locally stored data table witch has the exact same data.

After I changed the data source to local data table everything else works, but the Excpences switch(true) measure.

 

Before:

almafater2_2-1629879678971.png

 

After:

 

almafater2_3-1629879690940.png

 

Expences =

VAR CurrentItem = SELECTEDVALUE('IslaiduLentele Map'[Expences Type])

RETURN

SWITCH(TRUE(),

CurrentItem = "Kitos veiklos išlaidos", [Kitos veiklos išlaidos],

CurrentItem = "Už apskaitos paslaugas", [Už apskaitos paslaugas],

CurrentItem = "Už teisines paslaugas", [Už teisines paslaugas],

CurrentItem = "Už valdymą", [Sėkmės mokestis] + [nekintamas dydis],

CurrentItem = "sėkmės mokestis", [Sėkmės mokestis],

CurrentItem = "Už gautų paskolų palūkanas", [Už gautų paskolų palūkanas],

CurrentItem = "Už depozitoriumo paslaugas", [Už depozitoriumo paslaugas],

CurrentItem = "Už auditą", [Už auditą],

CurrentItem = "Už kitas administravimo išlaidas", [Kitos veiklos išlaidos],

CurrentItem = "Nekintamas dydis", [nekintamas dydis],

CurrentItem = "Visų išlaidų suma", [Visų išlaidų suma],

CurrentItem = "Bendrųjų išlaidų suma ir koeficientas", [Bendrųjų išlaidų suma ir koeficientas],

0)

 

 

All hese measures separetly give the correct result, but m SWITCH(TRUE) measure does not provide the expected result.
 

Does anybody know where the probloem might be?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try if mac can make a diff

 

Expences =

VAR CurrentItem = MAX('IslaiduLentele Map'[Expences Type])

RETURN

SWITCH(TRUE(),

CurrentItem = "Kitos veiklos išlaidos", [Kitos veiklos išlaidos],

CurrentItem = "Už apskaitos paslaugas", [Už apskaitos paslaugas],

CurrentItem = "Už teisines paslaugas", [Už teisines paslaugas],

CurrentItem = "Už valdymą", [Sėkmės mokestis] + [nekintamas dydis],

CurrentItem = "sėkmės mokestis", [Sėkmės mokestis],

CurrentItem = "Už gautų paskolų palūkanas", [Už gautų paskolų palūkanas],

CurrentItem = "Už depozitoriumo paslaugas", [Už depozitoriumo paslaugas],

CurrentItem = "Už auditą", [Už auditą],

CurrentItem = "Už kitas administravimo išlaidas", [Kitos veiklos išlaidos],

CurrentItem = "Nekintamas dydis", [nekintamas dydis],

CurrentItem = "Visų išlaidų suma", [Visų išlaidų suma],

CurrentItem = "Bendrųjų išlaidų suma ir koeficientas", [Bendrųjų išlaidų suma ir koeficientas],

0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try if mac can make a diff

 

Expences =

VAR CurrentItem = MAX('IslaiduLentele Map'[Expences Type])

RETURN

SWITCH(TRUE(),

CurrentItem = "Kitos veiklos išlaidos", [Kitos veiklos išlaidos],

CurrentItem = "Už apskaitos paslaugas", [Už apskaitos paslaugas],

CurrentItem = "Už teisines paslaugas", [Už teisines paslaugas],

CurrentItem = "Už valdymą", [Sėkmės mokestis] + [nekintamas dydis],

CurrentItem = "sėkmės mokestis", [Sėkmės mokestis],

CurrentItem = "Už gautų paskolų palūkanas", [Už gautų paskolų palūkanas],

CurrentItem = "Už depozitoriumo paslaugas", [Už depozitoriumo paslaugas],

CurrentItem = "Už auditą", [Už auditą],

CurrentItem = "Už kitas administravimo išlaidas", [Kitos veiklos išlaidos],

CurrentItem = "Nekintamas dydis", [nekintamas dydis],

CurrentItem = "Visų išlaidų suma", [Visų išlaidų suma],

CurrentItem = "Bendrųjų išlaidų suma ir koeficientas", [Bendrųjų išlaidų suma ir koeficientas],

0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you, it worked 🙂

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors