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.
I have a table in which I have to calculate the average sales per year and per customer and table is designed using different columns from different tables on which I have to remove filters except on invoicedate/year.
In that table I have an invoicedate column from which I have been calculating the distinct months in which invoices occur. I have calculated the distinct months through this logic below.
In this table I have to remove the filters on all the rows so that it return 12 in each row of 2021 and 3 for 2022.
What can be the daX expression for removing the filters on all rows present in the table except invoicedate/year?
Thank you
Solved! Go to Solution.
Hi @ScottWalter
you can try
var months =
CALCULATE (
COUNTROWS (
GROUPBY (
InvoiceLines,
InvoiceLines[INVOICEDATE].[Year],
InvoiceLines[INVOICEDATE].[MonthNo]
)
),
REMOVEFILTERS (),
VALUES ( InvoiceLines[INVOICEDATE].[Year] )
)
Hi @ScottWalter ,
Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.
Otherwise, could you please provide the Fields pane setting of your matrix visual? And is the field AXPAPPROVEDCREDITLIMIT also from the table InvoiceLines? Do you want all rows in 2021 to show 12 and all rows in 2022 to show 3 as marked in the screenshot below?
Fields pane setting
Best Regards
Hi @ScottWalter
you can try
var months =
CALCULATE (
COUNTROWS (
GROUPBY (
InvoiceLines,
InvoiceLines[INVOICEDATE].[Year],
InvoiceLines[INVOICEDATE].[MonthNo]
)
),
REMOVEFILTERS (),
VALUES ( InvoiceLines[INVOICEDATE].[Year] )
)
@ScottWalter can you share your pbix? Or a pbix with some mocked up data? Difficult to do without having data to work with...
User | Count |
---|---|
15 | |
13 | |
12 | |
10 | |
10 |
User | Count |
---|---|
19 | |
15 | |
14 | |
11 | |
10 |