Forum Discussion
Beginning and Ending value
PBI5851 , Create measure with help from date table
Beginnning = CALCULATE(sum(Table[Count]),filter(allselected(date),date[date] <=maxx(date,dateadd(date[date]),-1,Month)))
Ending = CALCULATE(sum(Table[Count]),filter(allselected(date),date[date] <=max(date[date])))
Reject1 = calculate(sum(Table[Count]), datesmtd(Date[Date]), filter(Table, Table[Flag] ="Reject1"))
Reject2 = calculate(sum(Table[Count]), datesmtd(Date[Date]), filter(Table, Table[Flag] ="Reject1"))
Reject3 = calculate(sum(Table[Count]), datesmtd(Date[Date]), filter(Table, Table[Flag] ="Reject1"))
Incoming = calculate(sum(Table[Count]), datesmtd(Date[Date]), filter(Table, Table[Flag] ="Incoming"))
In matrix use show on row
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
- PBI58515 years agoHelper V
Hi amitchandak,
Thank you for the solution. However, this will work only if no other value were to be added to the table. Its my mistake of overlooking that scenario and not providing that information in my question. If the incoming raw data was in this format where there are two more flags but do not account for the Beginning or End, then the "allselected" will not work. .
DateVal Count Flag 1/1/2021 100 Incoming 1/1/2021 -20 Reject1 1/1/2021 -10 Reject2 1/1/2021 -30 Reject3 2/1/2021 -5 Reject1 2/1/2021 -5 Reject2 2/1/2021 -10 Reject3 3/1/2021 20 Incoming 3/1/2021 -30 Reject1 4/1/2021 10 Incoming 1/1/21 30 Contaminated 2/1/21 20 user Error 3/1/21 10 Manufacturing And the matrix should be
How to achieve this ?