Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
we have created Spend Bucket using below Tableau formulas:
Payment Per Account = { FIXED [Vendor Name]:sum(ABS([Grss Amnt Usd]))}
using this have created Spend Bucket as below:
Spend Bucket =
IF[Payment Per Account]<=1000000 then "0-1M"
ELSEIF [Payment Per Account]>1000000 and [Payment Per Account]<=5000000 THEN "1-5M"
ELSEIF [Payment Per Account]>5000000 and [Payment Per Account]<=10000000 THEN "5-10M"
ELSEIF [Payment Per Account]>10000000 and [Payment Per Account]<=100000000 THEN "10-100M"
ELSEIF [Payment Per Account]> 100000000 then ">100M"
END
i have migrated these formulas in Power BI as below:
have created below measure,
Solved! Go to Solution.
You can simplify the spend bucket formula
Spend Bucket = SWITCH(TRUE(),
[Payment per account] <= 1000000, "1) 0-1M",
[Payment per account] <= 5000000 , "2) 1-5M",
[Payment per account] <= 10000000 , "3) 5-10M",
[Payment per account] <= 100000000 , "4) 10-100M",
"5) >100M")
If you don't want your month or year filter to impact the bucket then you need to add that exclusion to your measure (something like ALL(Year) etc )
Hi @MR007,
Did you mean to create a calculated field that can recognize these records to set the range category of them? If that is the csae, any regular in these conditions to setting categories?
AFAIK, these types of formulas are defined by 'start/end' range, excepted ranges, ranges with regular offsets. If your scenario meets this, you can refer to the following formula to use one dynamic condition to replace multiple regular range conditions.
Spend Bucket =
VAR currPay = [Payment per account_test] / 1000000
VAR offset = 5
VAR _rate =
INT ( currPay / offset )
RETURN
SWITCH (
TRUE (),
//start
currPay <= 1, "0-1M",
//first
currPay > 1
&& currPay <= offset, "1-5M",
//regular ranges
currPay > _rate * offset
&& currPay <= ( _rate + 1 ) * offset,
_rate * offset & "-" & _rate * offset & "M",
//last
currPay > 96
&& currPay <= 100, "96-100M",
//end
currPay > 100, ">100M"
)
Regards,
Xiaoxin Sheng
You can simplify the spend bucket formula
Spend Bucket = SWITCH(TRUE(),
[Payment per account] <= 1000000, "1) 0-1M",
[Payment per account] <= 5000000 , "2) 1-5M",
[Payment per account] <= 10000000 , "3) 5-10M",
[Payment per account] <= 100000000 , "4) 10-100M",
"5) >100M")
If you don't want your month or year filter to impact the bucket then you need to add that exclusion to your measure (something like ALL(Year) etc )
still facing the issue, proper bucketing not happening. created 2 formulas
1) measure:
i select one vendor name and highligted in yellow are my above calculated fields. as soon as i filter i get the spend bycke >100m & 1.gross-amt-ALLexcept is 131,923,680 no issues. As soon as i filter for say Jan'20
its still givin me 131923680 and >100m actually the amount should have shown 18548491 and bucket should have been 10-100M
Can you please how to fix this
Thanks in adavance
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
21 | |
2 | |
2 | |
2 | |
2 |