Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi @Everyone
I’m trying to replicate a Tableau-like behavior in Power BI with dynamic formatting for a commission measure. I created a measure with the following DAX:
commission_formatted_new =
SUMX(fact, fact[fee] * fact[rate_factor])
I then applied a dynamic format string using this DAX:
VAR currency = SELECTEDVALUE('currency'[Destination Currency Symbol], "*")
VAR currentvalue = [commission_formatted_new]
RETURN
SWITCH(TRUE(),
currentvalue <= 1000, currency & " #,0.00",
currentvalue <= 1000000, currency & " #,0,.00K",
currentvalue <= 1000000000, currency & " #,0,,.00M",
currentvalue <= 1000000000000, currency & " #,0,,,B"
)
What could be causing this inconsistency between the table and card visuals? Am I missing something about how dynamic format strings work in Power BI?
Any insights would be greatly appreciated!
Thanks!
Solved! Go to Solution.
Change the format setting in the card from Auto to None.
Otherwsie auto overrise you dynamic settings in the Card
Please click thumbs up and accept solution
my value = 8421234
Format rule =
VAR currency = "$"
VAR currentvalue = [my value]
RETURN
SWITCH(TRUE(),
currentvalue <= 1000, currency & " #,0.00",
currentvalue <= 1000000, currency & " #,0,.00K",
currentvalue <= 1000000000, currency & " #,0,,.00M",
currentvalue <= 1000000000000, currency & " #,0,,,B"
)
Change the format setting in the card from Auto to None.
Otherwsie auto overrise you dynamic settings in the Card
Please click thumbs up and accept solution
my value = 8421234
Format rule =
VAR currency = "$"
VAR currentvalue = [my value]
RETURN
SWITCH(TRUE(),
currentvalue <= 1000, currency & " #,0.00",
currentvalue <= 1000000, currency & " #,0,.00K",
currentvalue <= 1000000000, currency & " #,0,,.00M",
currentvalue <= 1000000000000, currency & " #,0,,,B"
)
Change the format setting in the card from Auto to None.
Otherwsie auto overrise you dynamic settings in the Card
Please click thumbs up and accept
solution
@kapildua16 , Try using
commission_formatted_new =
SUMX(fact, fact[fee] * fact[rate_factor])
commission_formatted_display =
VAR currency = SELECTEDVALUE('currency'[Destination Currency Symbol], "*")
VAR currentvalue = [commission_formatted_new]
RETURN
SWITCH(TRUE(),
currentvalue < 1000, currency & " " & FORMAT(currentvalue, "#,0.00"),
currentvalue < 1000000, currency & " " & FORMAT(currentvalue / 1000, "#,0.00") & "K",
currentvalue < 1000000000, currency & " " & FORMAT(currentvalue / 1000000, "#,0.00") & "M",
currentvalue < 1000000000000, currency & " " & FORMAT(currentvalue / 1000000000, "#,0.00") & "B",
currency & " " & FORMAT(currentvalue, "#,0.00")
)
Proud to be a Super User! |
|
User | Count |
---|---|
77 | |
76 | |
45 | |
31 | |
26 |
User | Count |
---|---|
98 | |
89 | |
52 | |
48 | |
46 |