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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
EugeneNovikov
Frequent Visitor

Stuck with DAX-ing slicer selection

Hi all, sitting a few days and no light in that tunnel... 

I have a simple ledger-like report. My entities are:

1. Accounts, can be in one of the 3 currencies: UAH, USD, EUR, where UAH is 'native' for the report and USD and EUR are 'foreign'
2. Currencies.
3. Ledger, which contains dated transactions in two fields:

a) native: always in UAH

b) foreign: in any of the 3 above currencies, if the account is in UAH, then the amounts in both fields coincide

4. Calendar

 

All 4 entities are connected by 1:n relationships as in the attached file. Note that the relationship between Accounts and Currencies is bi-directional. 

What I want to see in the report is described in the image but generally it's this rule to select Amount column for summing up [.Amount total] measure: 

1. Slicer clear or 

    One on more accounts in UAH selected or
    One or more accounts selected in two or more different currencies: u
se only data on Ledger[Amount UAH]

2. One or more accounts all in same single foreign (USD or EUR) currency selected: use only data on Ledger[Amount !UAH]

I also need a way to show the currency in which calculation was performed and have non-working measure [.Currency] for that. 


Files: 

Report image
PBIX

Any suggestions warmly welcome... thank you.

1 ACCEPTED SOLUTION
Rupak_bi
Super User
Super User

Hi @EugeneNovikov ,

 

Hope this solves your issue.

 

Rupak_bi_0-1740126478690.png

Rupak_bi_1-1740126630572.pngRupak_bi_2-1740126651485.png

 

Modify two measure as below

.Currency =
VAR max_Currency = max(  'Currency'[Currency])
VAR min_Currency = min(  'Currency'[Currency])        
Var check = if(max_Currency=min_Currency,max_Currency,"UAH")

RETURN
check
 
.Amount total=

VAR max_Currency = max(  'Currency'[Currency])
VAR min_Currency = min(  'Currency'[Currency])        
Var check = if(max_Currency=min_Currency,max_Currency,"UAH")
var check1 = switch(check,"USD","!UAH","EUR","!UAH","UAH","UAH","UAH")
RETURN
SWITCH(check1,"UAH",CALCULATE(SUM(Ledger[Amount UAH])),"!UAH",CALCULATE(SUM(Ledger[Amount !UAH])),"NA")
 
 
If this works, please accept as solution.


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

View solution in original post

2 REPLIES 2
Rupak_bi
Super User
Super User

Hi @EugeneNovikov ,

 

Hope this solves your issue.

 

Rupak_bi_0-1740126478690.png

Rupak_bi_1-1740126630572.pngRupak_bi_2-1740126651485.png

 

Modify two measure as below

.Currency =
VAR max_Currency = max(  'Currency'[Currency])
VAR min_Currency = min(  'Currency'[Currency])        
Var check = if(max_Currency=min_Currency,max_Currency,"UAH")

RETURN
check
 
.Amount total=

VAR max_Currency = max(  'Currency'[Currency])
VAR min_Currency = min(  'Currency'[Currency])        
Var check = if(max_Currency=min_Currency,max_Currency,"UAH")
var check1 = switch(check,"USD","!UAH","EUR","!UAH","UAH","UAH","UAH")
RETURN
SWITCH(check1,"UAH",CALCULATE(SUM(Ledger[Amount UAH])),"!UAH",CALCULATE(SUM(Ledger[Amount !UAH])),"NA")
 
 
If this works, please accept as solution.


Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Thank you, Rupak, very elegant indeed. Now I'm going to put in into my main schema bc that was a small test model. 🙂

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.