Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi folks,
How can I have an output on the table below using measure. Basically
if available is 0 the output is equal to Required,
if available is equal to required the output is 0,
if avaialable is greater than required the output is 0,
if available is less than required subtract required to avialable (required - Available = diff (output)
Thank you
Solved! Go to Solution.
Hi @AllanBerces ,
Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Create the new measure to filter.
Output Measure =
VAR Available = SELECTEDVALUE('Table'[Available])
VAR Required = SELECTEDVALUE('Table'[Required])
RETURN
IF(
Available = 0,
Required,
IF(
Available = Required,
0,
IF(
Available > Required,
0,
Required - Available
)
)
)
3.Drag the measure into the card visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AllanBerces ,
Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Create the new measure to filter.
Output Measure =
VAR Available = SELECTEDVALUE('Table'[Available])
VAR Required = SELECTEDVALUE('Table'[Required])
RETURN
IF(
Available = 0,
Required,
IF(
Available = Required,
0,
IF(
Available > Required,
0,
Required - Available
)
)
)
3.Drag the measure into the card visual. The result is shown below.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Thank you very much, working perfectly.
By the way Required and Available i used measure.
thank you
\use the following pattern for the dax code :
measure =
var ds_add =
addcolumns(
addcolumns (
values(tbl_name[col_name] ) // col_name = column ID , which contains the values : aaa, ccc,rrr ....
"requied" , [ required_measure],
"available", [available_measure]
),
"output",
switch(
true(),
[available] = 0 , [required],
[available]= [required] , 0 ,
[available] > [required] , 0 ,
[available] < [required] , [required] - [available]
)
)
var res=
maxx( ds_add , [output] )
return res
let me know if this helps .
If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution ✅
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠
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 |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 65 | |
| 39 | |
| 33 | |
| 23 |