Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Kalachuchi
Helper III
Helper III

Show only if Result is consistent

 

 have a table which has the following data.

FeedbackProviderNameWeekCustomerService.1 CustomerService.2 CustomerService.3OverAllRate
Jewell Maddox1SometimesSometimes RarelySometimes
Rolland Gerry3UsuallyUsuallyRarelyUsually
Kalyn Tara4Almost AlwaysUsuallyUsuallyUsually
Jewell Maddox2UsuallyUsuallyUsuallyUsually
Rolland Gerry2UsuallyUsuallyUsuallyUsually
Kalyn Tara2UsuallyUsuallyUsuallyUsually

I want to visualize/show if Feedbackprovider gets two consecutive weeks of same low rating (Usually and sometimes)

 

 

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Kalachuchi 

Here is one way.

1) Unpivot the service columns in Power Query:

unpivot.jpgunpivot1.JPG

2) create dimension tables for Provider Name, Service  and Week and set up the model like this:

model.JPG

 3) Create the following measures:

a. a measure to identify low ratings:

Low Rating =
CALCULATE (
    DISTINCTCOUNT ( FactTable[Rating] ),
    FactTable[Rating] IN { "Usually", "Sometimes" }
)

b. a measure to identify if the previous week has a low rating:

Prev Week =
CALCULATE (
    [Low Rating],
    FILTER (
        ALLEXCEPT ( FactTable, 'Dim Provider Name'[Name], 'Dim Service'[Service] ),
        FactTable[Week]
            = MAX ( FactTable[Week] ) - 1
    )
)

 

Create a table with the fields form the Dimension tables and add both measures to the "Filters on this visual" in the filter pane and set the values to 1.

If you want to see the ratings for both weeks, use this measure:

Ratings =
VAR PrevWeekR =
    CALCULATE (
        MAX ( FactTable[Rating] ),
        FILTER ( ALL ( FactTable ), FactTable[Week] = MAX ( FactTable[Week] ) - 1 )
    )
RETURN
    IF ( [Prev Week] = 1, MAX ( FactTable[Rating] ) & ", " & PrevWeekR )

 

and you get this (rows show the second week, where the previous week was also rated low):

result.JPG

I´ve attached the PBIX file for your reference

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

@Kalachuchi 

Here is one way.

1) Unpivot the service columns in Power Query:

unpivot.jpgunpivot1.JPG

2) create dimension tables for Provider Name, Service  and Week and set up the model like this:

model.JPG

 3) Create the following measures:

a. a measure to identify low ratings:

Low Rating =
CALCULATE (
    DISTINCTCOUNT ( FactTable[Rating] ),
    FactTable[Rating] IN { "Usually", "Sometimes" }
)

b. a measure to identify if the previous week has a low rating:

Prev Week =
CALCULATE (
    [Low Rating],
    FILTER (
        ALLEXCEPT ( FactTable, 'Dim Provider Name'[Name], 'Dim Service'[Service] ),
        FactTable[Week]
            = MAX ( FactTable[Week] ) - 1
    )
)

 

Create a table with the fields form the Dimension tables and add both measures to the "Filters on this visual" in the filter pane and set the values to 1.

If you want to see the ratings for both weeks, use this measure:

Ratings =
VAR PrevWeekR =
    CALCULATE (
        MAX ( FactTable[Rating] ),
        FILTER ( ALL ( FactTable ), FactTable[Week] = MAX ( FactTable[Week] ) - 1 )
    )
RETURN
    IF ( [Prev Week] = 1, MAX ( FactTable[Rating] ) & ", " & PrevWeekR )

 

and you get this (rows show the second week, where the previous week was also rated low):

result.JPG

I´ve attached the PBIX file for your reference

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@Kalachuchi , With help from a week table create measures like

 

This Week = CALCULATE(Count('Table'[CustomerService.1]), FILTER(ALL('Date'),'Week'[Week]=max('Week'[Week])), filter('Table', 'Table'[CustomerService.1] in {"Usually","Sometimes"}))
Last Week = CALCULATE(Count('Table'[CustomerService.1]), FILTER(ALL('Date'),'Week'[Week]=max('Week'[Week])-1), filter('Table', 'Table'[CustomerService.1] in {"Usually","Sometimes"}))

 

//final measure

Flag = if( not(isblank([This Week])) && not(isblank([Last Week])),1,blank())

 

In case week across year

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.