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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
GustavoV1
Frequent Visitor

How to created calculate columns based on slicers

Hi,

I am started to use PowerBI recently and I have a question.

Is it possible and how created a calculate column to do:

 

Using the items selected in slicer 1 and slicer 2, created a column which has the value of column "Mensual M" multiply by any factor from month of slicer 1 meanwhile values in previously month no change.

 

for the picture I would like created a column which from january and february  has the value of column "Mensual M" but March "Mensual M" * any factor.

 

Regards

 

Slicer2.jpg

2 REPLIES 2
Greg_Deckler
Super User
Super User

@GustavoV1 - Couple things. You can't do this with a calculated column, you will have to use a measure. Calculated columns are only calculated when data is refreshed so they cannot be dynamic. The other thing is that I am not understanding what you are trying to achieve exactly.

 

Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

I follow your advice and put som information.

I have:

  • a table with monthly plan production of materials
  • a table to group material from some category called "Grupo"

What we expected

  • We want simulate scenarios with following variables
    • Fix an % of increase o decrease monthly production.
    • Fix since when (month) this increase o decrease start.
  • with this scenario we can visualize how accumulate production change in time
  • we will use slicer to choose start period and what-if slicer to choose increase o decrease.

 

also put some outcomes expected

Regards

 

Table "Grupo Materiales"

idGrupoGrupo
1Masiva
2Intermedia
3Puntual
4En Desarrollo

 

Table "Plan Producción"

ProductonombremedidaGrupoTipoene-20feb-20mar-20abr-20may-20jun-20jul-20ago-20sept-20oct-20nov-20dic-20total 2020
HAX-23Madera 3x3unidadMasivaNuevo20123551581222232871015097330531.619
HAZ-22Madera 1x3unidadMasivaExistente45382197269167296352116251301242912.709
HAX-31Madera 2x4unidadIntermediaNuevo28431535736193318286108170198472992.611
HAX-22Madera 3x4unidadEn DesarrolloNuevo21329437311578161105185194247222592.246
HAX-32Madera 4x4unidadPuntualExistente99783573873022717051162150202472.050
HAX-44Madera 2x2unidadIntermediaExistente27441104611921048839473393641011.754
HAX-54Madera 2x6unidadEn DesarrolloNuevo325227259264388371582631953231562302.825
HAX-65Madera 4x5unidadPuntualNuevo541092811925747302396380731933992.357

 

Visualization expected:

 

outcome 1.jpgoutcome 2.jpg

 

 

 

 

 

 

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors