Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I have a table containing ratings of different products from all quarters.
I want to be able to lookup the previous quarter rating (add that as a new column to my table) to do further calculations in the future, but I'm having trouble referencing the columns from my table variables.
Info: NewHelperQuarter is last quarter, [Rating] is string, and EARLIER is so that the filter selects all rows from that previous quarter.
Is there any way to make SELECTCOLUMNS return a single column instead of table? I remember @TomMartens talked about data lineage in this post Do any of you know how to solve this?
For example I have "Product A", I want the Q4 "Product A" to have the Q3 rating as an entry, the Q3 "Product A" to have the Q2 rating etc. for all quarters and all products (Product A - Z)
Thank you!
@Anonymous , if you have a date use Time intelligence. Else have separate table for Year Qtr and create a rank column on that, join back on year qtr
examples
QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))
Qtr Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER('Date'[Date])))
Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))
Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),PREVIOUSQUARTER(('Date'[Date])))
new column
Qtr Rank = RANKX(all('Date'),'Date'[Year Qtr],,ASC,Dense) //YYYYQ
Measures
This Qtr = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])))
Last Qtr = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Qtr Rank]=max('Date'[Qtr Rank])-1))
Hi! Thank you for the help. I was just wondering do the examples sum all the sales from that quarter? Because my rating values are like "BBB" and I don't want to sum up the previous quarter.
For example I have "Product A", I want the Q4 "Product A" to have the Q3 rating as an entry, the Q3 "Product A" to have the Q2 rating etc. for all quarters and all products (Product A - Z for example)
Thank you!
User | Count |
---|---|
117 | |
73 | |
58 | |
49 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |