The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi
I have a very odd request in Power BI dashboard. We have report that fetches customer feedback score and the idea is to bring out the latest score everytimes a customer gives feedback. If customer gives 3 feedback in one quarter, the latest one should show up on report.
For example
This is the dashboard. Content hidden due to data privacy. As you can see one customer has given 2 feedbacks in quarter but both of the feedback appear in the dashboard.
Have written DAX in my older reports
Step 1: Concact Full name & Quarter
Nm_Qtr=
CONCATENATE
('Tbl Name'[Fullname],'Tbl Name'[YearQuarter])
Step 2: Do a row check
Row_Check =
ROWNUMBER
(
ORDERBY
(table 2[Createdon], DESC),
PARTITIONBY
([Nm_Qtr]))
We have date table (dim date ) that can join with feedback_created_dt and can bring latest feedback for the quarter (selected by user). Feedback_Created_Dt is one of the columns in fact table.
Question is: How to write DAX query to bring in most recent feedback in Quarter?
Hi @romilv1 ,
I hope this information proves helpful. Feel free to reach out if you have any further questions or would like to discuss this in more detail. If responses provided answers your question, please accept it as a solution so other community members with similar problems can find a solution faster.
Thank you.
Hi @romilv1 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you !!
Hi @romilv1 ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you @danextian and @Deku for prompt response.
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank s & Regards,
Rekha,
CustomerSupportTeam.
Hi @romilv1
Try either
LatestFeedbackScore =
VAR LatestDate =
CALCULATE(
MAX(FeedbackTable[FeedbackDate]),
ALLEXCEPT(FeedbackTable, FeedbackTable[CustomerID], FeedbackTable[Quarter])
)
RETURN
CALCULATE(
SELECTEDVALUE(FeedbackTable[FeedbackScore]),
FeedbackTable[FeedbackDate] = LatestDate
)
LatestFeedbackScore TopN =
VAR LatestFeedback =
TOPN (
1,
FILTER (
ALL ( FeedbackTable ),
FeedbackTable[CustomerID] = SELECTEDVALUE ( FeedbackTable[CustomerID] )
&& FeedbackTable[Quarter] = SELECTEDVALUE ( FeedbackTable[Quarter] )
),
FeedbackTable[FeedbackDate], DESC
)
RETURN
MAXX ( LatestFeedback, FeedbackTable[FeedbackScore] )
Please see the attached sample pbix.
Year Quarter | Name | Feedback |
2025-01 | Tom | some feedback |
2025-02 | Tom | and more |
If you want to get something like in the above
Feedback =
MAXX(
TOPN( 1, table, table[date], desc ) -- return the most recent row
, table[Feedback] -- return most recent row's feedback
)