The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
What I need is simple let me show:
I need one calculated column or measure to retrive only the negative values = -8 and other column just with positive values = 82
Thanks for lbendlin's concern about this issue.
Hi, @fbittencourt
Perhaps you changed DAX to the following DAX, hope that helps:
Measure to retrieve only negative values filtered by ID RESSOURCE:
SURPLAN_Negative = CALCULATE(
SUMX(
FILTER(
FAIT_INDICATEURS,
FAIT_INDICATEURS[Disponibilité Restante] < 0
),
FAIT_INDICATEURS[Disponibilité Restante]
),
FILTER(FAIT_INDICATEURS, FAIT_INDICATEURS[ID RESSOURCE] = [ID RESSOURCE])
)
Measure to retrieve only positive values filtered by ID RESSOURCE:
SURPLAN_Positive = CALCULATE(
SUMX(
FILTER(
FAIT_INDICATEURS,
FAIT_INDICATEURS[Disponibilité Restante] > 0
),
FAIT_INDICATEURS[Disponibilité Restante]
),
FILTER(FAIT_INDICATEURS, FAIT_INDICATEURS[ID RESSOURCE] = [ID RESSOURCE])
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Remember that MIN() and MAX() can take two parameters.
So to add up all the negative values use
SUM(MIN(FAIT_INDICATEURS[Disponibilité Restante],0))
and to sum up all positive values use
SUM(MAX(FAIT_INDICATEURS[Disponibilité Restante],0)