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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
MinCK
Frequent Visitor

dynamic benchmark based on filter

Hello eveyone, 

I am new to Power Bi, may post some stupid question and explanation, but please bear with me. I am learning little by little!

I am working on building benchmarking comparison dashboard on Power BI, using Direct Lake connection. I am aiming to build a barchart where I calculate the differences between my hotel score and other hotels score (based on the slicer selected). I saw some video on Youtube Power BI – Dynamic Benchmarking and Implementing dynamic benchmarking in Power BI which they illustrate my intention. However, they requires me to create a data table specifically for the benchmark, like HotelScore and HotelScore Benchmark. Direct Lake doesn't allow me to create table as easy as other modes. My only solution now is replicating the benchmarking table in SQL and push it the Lakehouse. 

MinCK_1-1744767578254.png

 

The screenshot shows what I am trying to do, showing all hotels name and, based on whatever hotel I selected, calculating the differences of the hotel score. Surely the hotel name can be shown as a group, region, etc. I did this in Tableau earlier and trying to move to Power BI.

 

So, my question is do we have any other easier way (DAX code, other setup) allowing me to get the same result without creating the benchmarking table as suggested in the Youtube?

Thank you for your comments in advance!

 

Best,

Min Chakranont

2 REPLIES 2
v-echaithra
Community Support
Community Support

Hi @MinCK ,

We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Chaithra.

TomMartens
Super User
Super User

Hey @MinCK ,

 

If your data visualization must show all hotels, you need the additional table because otherwise, only the selected table will appear.

 

It's important to understand that DAX does not allow you to show or hide categorical values (like hotels) inside a visualization, even though it sometimes seems possible. When talking about measures, it's possible to manipulate the current filter context that is applied before the numerical expression is evaluated (in my simple example below, it's the averaging of the SalesAmount). For this reason, there are two lines in the line chart, even if only color is selected:

image.png

The DAX of the measure "":

SalesAmount (ms) - Comparison = 

var tableOfAllColorsExceptSelected = 
    EXCEPT( 
        CALCULATETABLE( VALUES( 'DimProduct'[ColorName] ), REMOVEFILTERS('DimProduct'[ColorName] ) ) , 
        VALUES( 'DimProduct'[ColorName] )  
    ))
return

AVERAGEX(
    tableOfAllColorsExceptSelected,
    [SalesAmount (ms)] 
)

The important part is the EXCEPT( ... ) because it returns all the colors that are not selected, allowing me to calculate the average value.

If you require showing all colors in the visual (regardless of whether we are talking about a line chart or a table visual) but need to select one color/hotel, then you need the additional table.

 

Regarding the Direct Lake connection mode, be aware that adding a table to your semantic model by creating a view in your lakehouse will force the semantic model to fall back to Direct Query mode, which means the lakehouse needs an extra table.

 

Hopefully, this adds some new insights.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors