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.
How to create a new column dynamically in a measure with summarize that takes the value of one column based on the row of the maximum date that is present in another column in the summarized group.
I wouldn't be able have my table sorted by the date before loading the data, so I havent been able to use the FIRSTNONBLANKVALUE the way I want to
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, I create a sample.
In my understanding, the Date column changed dynamically in the data source, if you want to create a new column to get the Sales value on the maxmum date, here's my solution. The formula also works in a measure.
Column =
CALCULATE (
MAX ( 'Table'[Sales] ),
FILTER (
ALL ( 'Table' ),
'Table'[Date] = MAXX ( ALL ( 'Table' ), 'Table'[Date] )
)
)
Get the correct result.
If the maxmum date changed in the data source, it still works.
I attach my sample below for 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 @Anonymous ,
According to your description, I create a sample.
In my understanding, the Date column changed dynamically in the data source, if you want to create a new column to get the Sales value on the maxmum date, here's my solution. The formula also works in a measure.
Column =
CALCULATE (
MAX ( 'Table'[Sales] ),
FILTER (
ALL ( 'Table' ),
'Table'[Date] = MAXX ( ALL ( 'Table' ), 'Table'[Date] )
)
)
Get the correct result.
If the maxmum date changed in the data source, it still works.
I attach my sample below for 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.
"create a new column dynamically in a measure"
You cannot create columns from measures. Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?