Set a Minimum Sample Size of n Number to Show Visual

@iasma,

Totally doable in Power BI, using a couple of cool tricks to control transparency of visuals via DAX and conditional formatting. Here’s a basic mockup of your scenario that I created:

The trick here is to create your visuals as normal, and then create a card that says “Insufficient Sample Size” or something to that effect. You can then use the transparency attribute (00) of hex codes to make the background and font of the overlaying card transparent or not, depending on whether or not your sample size is greater than the designated sample size threshold for display.

In this case, I set the sample size for display threshold using a what-if parameter. I actually synced this to a slider on the front page, so that you can control the visuals on all pages using this front-page setting (as long as you sync each page to that page 1 slider).

Here are the two key measures you need to control the transparency of the background and the font for the overlaying card:

CF Background = 
IF(
    [Sample Size] >= [Sample Size Threshold Value],
    "#FFFFFF00",
    "#FFFFFF"
)

CF Font = 
IF(
    [Sample Size] >= [Sample Size Threshold Value],
    "#FFFFFF00",
    "Black"
)

I hope this is helpful. Full solution file attached.

1 Like