Forum Discussion
Dynamic Format Measures
- Anonymous2 years ago
Hi JB_AT
First of all, thanks to some_bih for your timely and effective response.
Here is my testing.
My sample:
slicer table:
data table:
I don't have your source data, so I don't know how [Actuals Calc] is obtained, so I created the following formula just to get a measure.
Actuals Calc1 = SUM('Table'[Actuals Calc])Then I modified your formula.
measure = SWITCH( SELECTEDVALUE ( NumberFormatCalc[Format] ), "Ones", FORMAT(ROUND ( [Actuals Calc1], 1 ), "0.0"), "Thousands", FORMAT(ROUND ( DIVIDE ( [Actuals Calc1], 1000 ), 1 ), "0.0"), "Millions", FORMAT(ROUND ( DIVIDE ( [Actuals Calc1], 1000000 ), 1 ), "0.0") )Result:
Is this the result you expect?
If I've misunderstood you, please provide detailed sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Yulia XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi JB_AT
First of all, thanks to some_bih for your timely and effective response.
Here is my testing.
My sample:
slicer table:
data table:
I don't have your source data, so I don't know how [Actuals Calc] is obtained, so I created the following formula just to get a measure.
Actuals Calc1 = SUM('Table'[Actuals Calc])
Then I modified your formula.
measure = SWITCH(
SELECTEDVALUE ( NumberFormatCalc[Format] ),
"Ones", FORMAT(ROUND ( [Actuals Calc1], 1 ), "0.0"),
"Thousands", FORMAT(ROUND ( DIVIDE ( [Actuals Calc1], 1000 ), 1 ), "0.0"),
"Millions", FORMAT(ROUND ( DIVIDE ( [Actuals Calc1], 1000000 ), 1 ), "0.0")
)
Result:
Is this the result you expect?
If I've misunderstood you, please provide detailed sample data and the results you are hoping for: How to provide sample data in the Power BI Forum - Microsoft Fabric Community . Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you Anonymous
This helps a lot.