Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi,
I have a Date and Sales table.
I've created a measure based on the due date and a date filtered by the user, to know the payment deadline (nº days) for our customers.
The problem is that, besides this, I want to sum the unpaid amout per each line returned by the measure above.
How can I do this using DAX?
Best regards,
Filipe Gaspar
Solved! Go to Solution.
@FGaspar ,
You can create a period number column. Give the first 30/60/90 days a flag "1", give the second 30/60/90 days a flag "2" and so on. Then create a slicer based on the period column.
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@FGaspar ,
Have you tried dax like pattern below?
Result =
SUMX ( Table, [Measure] )
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @FGaspar ,
Wouldn't that be something like Measure = SUM(Sales[Amount]) in the same visual you have your previous measure?
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Keep those thumbs up coming! 🙂
Proud to be a Super User!
Hi,
I've created report with a table (image attached). One of the columns (Due18_3) of this table should be the sum of the column "Amount", based on the date selected in the date filter (slicer):
It works fine if I use a fixed number, for example, sum of Amount with Antiguidade >18:
@FGaspar ,
You can use selectedvalue() to achieve the value in your slicer as below:
Due18_v3 =
VAR SelectedValue =
SELECTEDVALUE ( Calendar[Date] )
VAR total =
CALCULATE (
SUM ( v_GB_Detailed_Customer_Ledger_Entry_Agrupada[Amount] );
FILTER (
v_GB_Detailed_Customer_Ledger_Entry_Agrupada;
[Antiguidade_fix_date] > SelectedValue
)
)
RETURN
IF (
HASONEVALUE ( v_GB_Detailed_Customer_Ledger_Entry_Agrupada[Initial Entry Due Date] );
IF (
[Antiguidade_fix_date] > SelectedValue;
SUM ( v_GB_Detailed_Customer_Ledger_Entry_Agrupada[Amount] );
BLANK ()
);
total
)
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Your formula works accordingly - know the total due amount, within the filter.
Besides using the slicer filter, is it possible to filter by period of days (30, 60, 90 days)?
I tried to create a new measure for 30 days (Due30New), but it's not working:
Due30New =
var SelectValue =
SELECTEDVALUE(Calendario[data])
var total =
calculate(
sum(v_GB_Detailed_Customer_Ledger_Entry_Agrupada[Amount]);
filter(
v_GB_Detailed_Customer_Ledger_Entry_Agrupada;
[Antiguidade]>SelectValue && [Antiguidade]<=30
)
)
return
if(
hasonevalue(v_GB_Detailed_Customer_Ledger_Entry_Agrupada[Initial Entry Due Date]);
if(
[Antiguidade]>SelectValue && [Antiguidade]<=30;
sum(v_GB_Detailed_Customer_Ledger_Entry_Agrupada[Amount]);
blank()
);
total
)
The value is right at the line level, but the total is wrong.
Aditional note: I've created a new measure (Selected Value) to see the values of the VAR "SelectedValue", but I don't get any results:
@FGaspar ,
You can create a period number column. Give the first 30/60/90 days a flag "1", give the second 30/60/90 days a flag "2" and so on. Then create a slicer based on the period column.
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I create a period number column, how can I update the corresponding flag, based on the on the slicer selected date?
The slicer date filter the base for both results:
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 |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |