Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
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 all,
I'm a new user here, require some help. I have a column with the following values. What I would like to do is to substract the total count of "Return" to the total count of "Loan". How do I go about doing that? I've been trying all ways and nothing seems to cut it.
Solved! Go to Solution.
A simple way would be following measure:
Measure =
CALCULATE (
SUM ( table[value] ), table[operation_type_desc (groups)] = "Return"
)
-
CALCULATE (
SUM ( table[value] ), table[operation_type_desc (groups)] = "Loan"
)If your table is filtered with the slicers, you may need to adjust the measure to manipulate filter context.
@vik0810 wrote:A simple way would be following measure:
Measure = CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Return" ) -
CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Loan" )If your table is filtered with the slicers, you may need to adjust the measure to manipulate filter context.
Awesome! I only needed to make minor adjustment (instead of SUM, I used Count) and it works. Thank you!
Regards
E
Hi @powerbiusernew ,
A simple way would be following measure:
Measure =
CALCULATE (
SUM ( table[value] ), table[operation_type_desc (groups)] = "Return"
)
-
CALCULATE (
SUM ( table[value] ), table[operation_type_desc (groups)] = "Loan"
)If your table is filtered with the slicers, you may need to adjust the measure to manipulate filter context.
@vik0810 wrote:A simple way would be following measure:
Measure = CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Return" ) -
CALCULATE ( SUM ( table[value] ), table[operation_type_desc (groups)] = "Loan" )If your table is filtered with the slicers, you may need to adjust the measure to manipulate filter context.
Awesome! I only needed to make minor adjustment (instead of SUM, I used Count) and it works. Thank you!
Regards
E
Hi @powerbiusernew ,
Glad to hear that. Please accept your solution above so that people who may have the same question can get the solution directly.
Best Regards,
Icey
I'm not sure I understand correctly. Is this what you're looking to do?
If you want to count the number of records of Type Loan and subtract the number of records of Type Return, you would create a column like this. A row with Loan gets a value of 1, a row with a Return gets a value of -1, everything else has 0 impact.
YourColumnName = if([operation_type_desc (groups)] = "Loan";1;if([operation_type_desc (groups)]= "Return";-1;0))
You can now use this column to display the value of (number of Loans -/- number of Returns)
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 |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 73 | |
| 72 | |
| 34 | |
| 33 | |
| 31 |