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.
I have a user that wants a table that computes the number of invoices late for a date range and then provides a summary for the whole period. I'm having trouble even conceptualizing how the calculate or filter DAX would be. I tried joining to a duplicate table on the period alone, but when I put it in a visualization it shows the same total for everything/for the entire dataset.
Data:
Desired Output
Solved! Go to Solution.
Hi @jondufault ,
According to your description, here's my solution.
1.Create a new Status table as below, don't make relationship with the fact table.
2.Create two measures:
Count Date =
COUNTROWS (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[status] = MAX ( 'Status'[Status] ) )
) + 0
Count Period =
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[period]
IN VALUES ( 'Table'[period] )
&& 'Table'[status] = MAX ( 'Status'[Status] )
)
)
Put the new status column and two measures in a visual, get the correct result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jondufault ,
According to your description, here's my solution.
1.Create a new Status table as below, don't make relationship with the fact table.
2.Create two measures:
Count Date =
COUNTROWS (
FILTER ( ALLSELECTED ( 'Table' ), 'Table'[status] = MAX ( 'Status'[Status] ) )
) + 0
Count Period =
COUNTROWS (
FILTER (
ALL ( 'Table' ),
'Table'[period]
IN VALUES ( 'Table'[period] )
&& 'Table'[status] = MAX ( 'Status'[Status] )
)
)
Put the new status column and two measures in a visual, get the correct result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Your logic for "Count Period" is not clear. Please elaborate.
User | Count |
---|---|
79 | |
73 | |
39 | |
30 | |
28 |
User | Count |
---|---|
108 | |
99 | |
55 | |
49 | |
45 |