Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello Power BI community,
I need to subtract a value of 17.11 from a specific measure I have within a table for a specific month and document number, but I do not want this value subtracted from other measures or months / document numbers that I have within the same DAX formula.
Below is a copy of my DAX formula:
Solved! Go to Solution.
Hi @sergiodefreitas ,
According to your description, you want to subtract 17.11 in a specific case, you can see in your measure that you subtracted the value from your measure under your judgment. But you say "also subtracts the value of 17.11 from the other month which I have in my formula, which is August".
This situation needs to be combined with the fields you place on top of the visual.
The measure is calculated as the result under the current filter context, and you can use your measure:
CALCULATE([DevLIQ-IVA]-17.11, 'wgcDocLinhas'[Serie] IN { 21 }, 'wgcDocLinhas'[Data].[ Mês] IN {"julho"}, 'wgcterceiros'[TipoDoente] IN { "GRUPO" }, 'wgcDocLinhas'[Numdoc] IN { 16 }, 'wgcDocLinhas'[Tipodoc] IN { "NC" })
Test in your visual that the value he returns is the same as you expected.
Refer this docunment , you can store the result of an expression as a named variable, which can then be passed as an argument to other measure expressions. Once resultant values have been calculated for a variable expression, those values do not change, even if the variable is referenced in another expression.
And for your needs, you can also provide your sample data, please pay attention to protect private data, and give us the sample data you want in the form of a table, so that we can better help you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sergiodefreitas ,
According to your description, you want to subtract 17.11 in a specific case, you can see in your measure that you subtracted the value from your measure under your judgment. But you say "also subtracts the value of 17.11 from the other month which I have in my formula, which is August".
This situation needs to be combined with the fields you place on top of the visual.
The measure is calculated as the result under the current filter context, and you can use your measure:
CALCULATE([DevLIQ-IVA]-17.11, 'wgcDocLinhas'[Serie] IN { 21 }, 'wgcDocLinhas'[Data].[ Mês] IN {"julho"}, 'wgcterceiros'[TipoDoente] IN { "GRUPO" }, 'wgcDocLinhas'[Numdoc] IN { 16 }, 'wgcDocLinhas'[Tipodoc] IN { "NC" })
Test in your visual that the value he returns is the same as you expected.
Refer this docunment , you can store the result of an expression as a named variable, which can then be passed as an argument to other measure expressions. Once resultant values have been calculated for a variable expression, those values do not change, even if the variable is referenced in another expression.
And for your needs, you can also provide your sample data, please pay attention to protect private data, and give us the sample data you want in the form of a table, so that we can better help you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |