Forum Discussion
Is this possible in a matrix?
I am tryinig to write a measure to show project totals (ignoring selected dates and summing fee for all dates) on the project total lines of a matrix. Is this even possible? The date lines would be blank in the Fee All Years colum. Whenever I write a meausre using All or Remove Filters I get date lines that I dont want. I only want date lines for the selected year but fee for all years to show at the summery level of each project.
3 Replies
- amitchandak
Super User
mgrayTCB,Based on what I got
You can max(Table[Date]) to check date or isinscope to check level
You can create a measure like
calculate(sum(Table[Value]), filter(allselected(Table), Table[Project] = max(Table[Project]))
This will project level sum
https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/
- mgrayTCB
Helper IV
Thanks but I might need a few more bread crumbs.... and I am not sure I understand the IsInScope suggestion.
Using your notes I wrote this measure:
xtest SumAllyears2 =CALCULATE([TCBFee],FILTER(ALLSELECTED(project),project[ProjectName] = max(project[ProjectName])))Which does not ignore the date row context and gets me what I already had.For each project I am hoping to have this:
- AnonymousNot applicable
Hi mgrayTCB,
Please take a look at the following link about use Dax format to check hierarchy levels, then you can mix if statement with a custom expression to show or replace specific data level results in a matrix visual.
Clever Hierarchy Handling in DAX - SQLBI
If you confused about the coding formula, can you please share a pbix file with some dummy data (keep the raw data structure) and expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng