Power BI – How to set default selection ...

Power BI – How to set default selection on card

Jul 05, 2020

Say you have a table like the one below.

data tableIt is a Company’s Gross Profit on YTD and you want to display it in a graph with a year selection and a card to display the value (like the one below). imageThe card shows the sum of all the Gross Profit which is wrong because the it is YTD. To correct this, we are going to add the measure below.

Gross Profit = CALCULATE(SUM(GrossProfit[GrossProfit]),

FILTER(

GrossProfit,GrossProfit[Year] = MAX(GrossProfit[Year])

)

)

image

What this does is it calculates the sum of Gross Profit with year as its filter. When no Year is selected, the MAX function will get highest year and when a year is selected, the MAX function will return what YEAR is currently selected.

This post was originally published on acedbi.wordpress.com.

Подобається цей допис?

Купити для Bennie Jay Guevarra каву