Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |