Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
hello everyone, I created several validations (functions) within DAX and two measurements that bring me the accumulated and an indication when the value. The result was a success but the table has the same code repeated when the indicator appears in red (X)
RESULT:
I would like help to have a solution in DAX so that it only shows the first time that X appeared by code (Nr Case).
Thanks for any help 😉
Solved! Go to Solution.
Hi @Spotto
place this measure in the filter pane and select valvue not equal 1
Filter Measue =
VAR CurrentIndex =
MAX ( 'Relatório de Histórico de Casos'[INDEX] )
VAR PreviousIndex = CurrentIndex - 1
VAR PreviousSlaEstour =
CALCULATE (
[Sla Estourado],
'Relatório de Histórico de Casos'[INDEX] = PreviousIndex
)
RETURN
[Sla Estourado] * 2 - PreviousSlaEstour
Hi @Spotto
place this measure in the filter pane and select valvue not equal 1
Filter Measue =
VAR CurrentIndex =
MAX ( 'Relatório de Histórico de Casos'[INDEX] )
VAR PreviousIndex = CurrentIndex - 1
VAR PreviousSlaEstour =
CALCULATE (
[Sla Estourado],
'Relatório de Histórico de Casos'[INDEX] = PreviousIndex
)
RETURN
[Sla Estourado] * 2 - PreviousSlaEstour
thank you very much for your help, but the measure you suggested removes all the items that have the (X) in red. I need you to bring the first time the X (red) appeared by (Nr Case) as shown in photo 2.
I put the power bi code below.
https://drive.google.com/file/d/10acO0PeGIfRahWRSMZzmTuzkrg-HIHhE/view?usp=sharing
could you please attach the file with the filter because this option is not shown for me in the filters, I tried all the options and it didn't work, thanks
Hi @Spotto
The WeTransfer Link is there in the comment. Just click to download.
I understand what happened, the measure worked, thank you very much, but if I add a column as an example, category or a date, the measure stops working. Could you test this possibility to add columns (category, date) and the measure continues to work?
Spottoo
Here is an updated file https://wetll/tRMPAENjjpaa
Yes that is true. When you add a column from adimensionn table the filter context will change by creating a CROSSJOIN between both tables. But this is not a problem in the filter measure. If you want to add any column (for example Category) from a dimension table you can add it as measure
Category =
CALCULATE (
SELECTEDVALUE ( 'CATEGORIA X PRIORIDADE'[Categoria] ),
CROSSFILTER ( 'RelatóriodeeHistóricoodee Casos'[Categoria],'CATEGORIA X PRIORIDADE'[Categoria], Both )
)
In the sample file I have, there is no relationship with date therefore adding date has no meaning unless it has a relationship with the fact table. Once the relationship is set then you can follow same procedure of creating proper measure.
AMAZING, I didn't know it was possible to create columns from measurements, another day of learning. Thank you so much for your time spent helping me.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
46 | |
28 | |
22 | |
12 | |
8 |
User | Count |
---|---|
75 | |
53 | |
46 | |
15 | |
12 |