Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi
I have a measure which was giving an error when I maintained straight forward calculation as "[Target] / [Sales %]", I thought it could be due to blank or 0 value in the Target and maintained a DAX code as below. This code is working fine for few product Id and not for few, ending up with the below error message.
Measure 1 =
IF(
OR(
ISBLANK([Target]),
[Target] == 0
),
BLANK(),
[Target] / [Sales %]
)
| Target | Sales % | Measure 1 |
| 535 | 1.867% | 28670 |
| 518 | 1.867% | 27764 |
| 488 | 1.867% | 26150 |
Any expert advise please.
Thanks
Mahad
Solved! Go to Solution.
Hi @Anonymous ,
According to the error message, it seems that the problem is caused by the data type mismatch... The required data type is numeric, but the actual data type of [Target] or [Sales %] is Text type.... You can follow the methods below:
1. Please make sure the previous two measures only have the numeric values and the correct data type be set for them just as suggestd by @amitchandak
2. Update the formula of [Measure 1] as below if you can make sure they only have the numeric values. Later checck if it can work well...
Measure1 =
IF (
OR ( ISBLANK ( [Target] ), [Target] = 0 ),
BLANK (),
DIVIDE ( value([Target]), value([Sales %]), 0 )
)
Best Regards
Hi @Anonymous ,
According to the error message, it seems that the problem is caused by the data type mismatch... The required data type is numeric, but the actual data type of [Target] or [Sales %] is Text type.... You can follow the methods below:
1. Please make sure the previous two measures only have the numeric values and the correct data type be set for them just as suggestd by @amitchandak
2. Update the formula of [Measure 1] as below if you can make sure they only have the numeric values. Later checck if it can work well...
Measure1 =
IF (
OR ( ISBLANK ( [Target] ), [Target] = 0 ),
BLANK (),
DIVIDE ( value([Target]), value([Sales %]), 0 )
)
Best Regards
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |