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
Hello,
I'm using following measure to sum the InOut under the condition to filter the card visual only when I selected a stockmaterial and also replaced the typical blank when nothing is selected with "Please select stockmaterial":
| Stockmaterial | Index | InOut | ||
| a | i | 1000 | ||
| aa | o | -1000 | ||
| bb | i | 800 | ||
| bb | o | -750 | ||
| c | i | 32 | ||
| d | i | 4234 | ||
| d | i | 757 | ||
| e | i | 234 | ||
| e | i | 234 | ||
| a | o | -683 | ||
| a | o | -962 |
Solved! Go to Solution.
Download example PBIX file with the following code and visuals.
I'm not sure if you are asking to show 0 or BLANK() in trhe card visuals. Either way, it's easy to change.
Using these 3 measures
Sum InOut = IF ( ISFILTERED('DataTable'[Stockmaterial]), CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[Stockmaterial] = SELECTEDVALUE('DataTable'[Stockmaterial]))), "Please select stockmaterial")
Sum Ins = CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[index] = "i" && 'DataTable'[Stockmaterial]= SELECTEDVALUE('DataTable'[Stockmaterial]))) + 0
Sum Outs = CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[index] = "o" && 'DataTable'[Stockmaterial]= SELECTEDVALUE('DataTable'[Stockmaterial]))) + 0
Will give you the desired outputs in your cards
If you want the Sum In and Sum Out cards to show BLANK() rather than 0, remove the + 0 from the end fo each measure, e.g.
Sum Outs = CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[index] = "o" && 'DataTable'[Stockmaterial]= SELECTEDVALUE('DataTable'[Stockmaterial])))
Regards
Phil
Proud to be a Super User!
"What I want to archieve is that when I select a stockmaterial with no outbound yet that the outbound cardvisual always show blank() instead of "0". "
You can try this measure
Measure =
var _value=CALCULATE(SUM('Table'[InOut]),FILTER(ALLEXCEPT('Table','Table'[Stockmaterial]),'Table'[InOut]<0))
return
IF(ISFILTERED('Table'[Stockmaterial]),IF(ISBLANK(_value),BLANK(),_value),"Please select stockmaterial")
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
"What I want to archieve is that when I select a stockmaterial with no outbound yet that the outbound cardvisual always show blank() instead of "0". "
You can try this measure
Measure =
var _value=CALCULATE(SUM('Table'[InOut]),FILTER(ALLEXCEPT('Table','Table'[Stockmaterial]),'Table'[InOut]<0))
return
IF(ISFILTERED('Table'[Stockmaterial]),IF(ISBLANK(_value),BLANK(),_value),"Please select stockmaterial")
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Download example PBIX file with the following code and visuals.
I'm not sure if you are asking to show 0 or BLANK() in trhe card visuals. Either way, it's easy to change.
Using these 3 measures
Sum InOut = IF ( ISFILTERED('DataTable'[Stockmaterial]), CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[Stockmaterial] = SELECTEDVALUE('DataTable'[Stockmaterial]))), "Please select stockmaterial")
Sum Ins = CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[index] = "i" && 'DataTable'[Stockmaterial]= SELECTEDVALUE('DataTable'[Stockmaterial]))) + 0
Sum Outs = CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[index] = "o" && 'DataTable'[Stockmaterial]= SELECTEDVALUE('DataTable'[Stockmaterial]))) + 0
Will give you the desired outputs in your cards
If you want the Sum In and Sum Out cards to show BLANK() rather than 0, remove the + 0 from the end fo each measure, e.g.
Sum Outs = CALCULATE(SUM('DataTable'[InOut]), FILTER(ALL('DataTable'), 'DataTable'[index] = "o" && 'DataTable'[Stockmaterial]= SELECTEDVALUE('DataTable'[Stockmaterial])))
Regards
Phil
Proud to be a Super User!
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.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 39 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |