Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I have a country table contains 3 country like India,US,UK
country | Decimal Place
IN 2
US 3
UK 4
while showing the values based on country wise i want display my sales amount with those decimals places only
how do i pass Decimal places values dynamically to my format Function
after sometime my country's table will grow
Could you please help me on this.
For now i used the below DAX:
Regards
Mallikarjun
@mallik999
The downside to this approach is the result is a text, allows no calculation. If you want to have it, 1st create a table of countries and their respective decimal places like below
Add a measure as follows:
New Value =
VAR COU = SELECTEDVALUE(Query1[Country])
VAR DEC = LOOKUPVALUE(CountryDemimal[Decimal],CountryDemimal[Country],COU,"0,0.00")
RETURN
IF( NOT ISBLANK(COU) ,
FORMAT(MAX(Query1[PRODUCT_VAL] ), DEC)
)
You will have the desired output and it is dynamic when more countries are added:
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@mallik999 , See if a measure like this can help
//line level
Switch( True() ,
max(Query1[COUNTRY])="IN",FORMAT(Query1[PRODUCT_VAL],"0.00"),
Max(Query1[COUNTRY])="US",FORMAT(Query1[PRODUCT_VAL],"0.000") )
// based on selected value from slicer
Switch( True() ,
selectedValue(Query1[COUNTRY])="IN",FORMAT(Query1[PRODUCT_VAL],"0.00"),
selectedValue(Query1[COUNTRY])="US",FORMAT(Query1[PRODUCT_VAL],"0.000") )
I am facing same issue but this solution is not helping.
I am having a measure called Amount.
i want this measure to display value based on another column code.
if code is 0 no decimal value, if code is 1 one decimal value , if 2 then 2 values if 3 then 3.
i did this but seems not to be working :
oustanding_Amount:=Switch( True() ,
selectedValue(Test_code[code])=0,FORMAT([Amount],"0"),
selectedValue(Test_code[code])=1,FORMAT([Amount],"0.0"),
selectedValue(Test_code[code])=2,FORMAT([Amount],"0.00"),
selectedValue(Test_code[code])=3,FORMAT([Amount],"0.000"))
User | Count |
---|---|
53 | |
35 | |
20 | |
16 | |
15 |
User | Count |
---|---|
94 | |
74 | |
30 | |
22 | |
16 |