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.
hi all,
i've been facing a while in the following calculation.
I have a table which contains for each store the status (open, closed or opening -it's before the opening), and the date of check.
Now: i'd like to calculate the followings:
below the link with a sample
https://drive.google.com/file/d/1B68eDEGq0Gr3Z46ozuFxm-4dgX_riSiO/view?usp=sharing
do you think is it something feasible with power bi?
thanks in advance, and for further details please do not hesitate!
Solved! Go to Solution.
Hi @Anonymous,
You mean we just need to consider the [date] and the [status]. If so, try this one, please.
ifNewOpen = VAR existedStores = CALCULATETABLE ( VALUES ( store_progress[store] ), FILTER ( ALL ( 'store_progress' ), 'store_progress'[date] <= EOMONTH ( EARLIER ( [date] ), -1 ) && store_progress[status] = "open" ) ) RETURN IF ( [store] IN existedStores || NOT [status] = "open", "No", "Yes" )
Best Regards,
adding:
Hi @Anonymous,
Please download the demo from the attachment.
Since you'd like to filter them in the visual, I think we need a calculated column.
ifNewOpen = VAR existedStores = CALCULATETABLE ( VALUES ( store_progress[store] ), FILTER ( ALL ( 'store_progress' ), 'store_progress'[date] <= EOMONTH ( EARLIER ( [date] ), -1 ) ) ) RETURN IF ( [store] IN existedStores, "No", "Yes" )
Then count the [ifNewOpen] directly or create a measure.
Measure = VAR existedStores = CALCULATETABLE ( VALUES ( store_progress[store] ), FILTER ( ALL ( 'Calendar'[Date] ), 'Calendar'[Date] <= EOMONTH ( MIN ( 'Calendar'[Date] ), -1 ) ) ) RETURN CALCULATE ( COUNT ( store_progress[store] ), FILTER ( ALL ( store_progress[store] ), NOT [store] IN existedStores ) )
A date table is always necessary for the time intelligence functions.
Best Regards,
hi , thank you for your answer!
unfortunately, looking at the results, the open status is not working really well.
highlighted where the Yes is expected to be shown, while in Red the wrong attribution.
basically, there'd be to create a formula working at a cell level which, for the first time a row made by date&status, has the value "open".
any advice?
best
Hi @Anonymous,
You mean we just need to consider the [date] and the [status]. If so, try this one, please.
ifNewOpen = VAR existedStores = CALCULATETABLE ( VALUES ( store_progress[store] ), FILTER ( ALL ( 'store_progress' ), 'store_progress'[date] <= EOMONTH ( EARLIER ( [date] ), -1 ) && store_progress[status] = "open" ) ) RETURN IF ( [store] IN existedStores || NOT [status] = "open", "No", "Yes" )
Best Regards,
it works, that's great! you've made my day 🙂
thanks a lot for your help
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |