Power BI: display same results for a category

In some reports, I need to show the same results for a specific category, the most common one is related to the quarter, for instance, I want to display the same results for all months of the quarter 1. I have this data:

power bi

I have 4 different supports:

  • 2 have quarterly results: unix and oracle
  • 2 have monthly results: windows and database

The issue I have is about the quarter because people put the result anywhere, for instance, for the quarter 1, they can put either in January, February or March. In my example:

  • Unix is on January
  • Oracle is on February

In such situation, I need to display the same results for each month of the same quarter with this formula:

  • Calculated column:
    CALCULATE(FIRSTNONBLANK('table'[argument1],0),FILTER('table','table'[argument2]=EARLIER('table'[argument2]) && 'table'[argument3]=EARLIER('table'[argument3])))
    power bi
  • Measure:
    CALCULATE(FIRSTNONBLANK('table'[argument1],0),FILTER('table','table'[argument2]=MIN('table'[argument2]) && 'table'[argument3]=MIN('table'[argument3])))
    power bi

NOTE: change table and argument by yours

I will create a chart for unix, take note if I am using the calculated column, I have to change the calculation type:

power bi power bi

Result for the calculated column:

power bi

Result for the measure:

power bi

Let’s go a little further, the above formulas won’t work for windows and database because they are monthly. To have all of them in the same chart, I will need to create a new measure with this formula:

IF(MIN('table'[argument1])="quarterly",AVERAGE('table'[argument2]),SUM('table'[argument3]))

power bi

Result for oracle (quarterly):

power bi

Result for windows (monthly):

power bi

Now if I don’t want to use a measure but a calculated column, I don’t have to create a new column, I just need to use the “result” column.

Result for oracle (quarterly):

power bi

Result for windows (monthly):

power bi

For a visual card, I will use “measure 2” but if I have to use a column, I will create a new column with this formula:

IF('table'[argument4]="value",formula of the calculated column,'table'[argument1])

power bi
power bi

Interesting Topics