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.
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...
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 |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
8 |