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.
Hi,
I am trying to get daily percent of total week projection and I dont know what am I doing wrong, please help.
Solved! Go to Solution.
Hi @zibster ,
Try this one
Measure =
VAR __week =
MAX ( 'DatesTB'[WEEK] )
RETURN
DIVIDE (
SUM ( 'SLYProj'[Sales] ),
CALCULATE (
SUM ( 'SLYProj'[Sales] ),
FILTER ( ALL ( 'DatesTB' ), 'DatesTB'[WEEK] = __week )
)
)
Tip1. If you use FILTER function to calculate an expression in different context then most of the time you need to remove all filters using a function ALL.
Tip2. Also, we need to mention a proper filter by a week of current context. In a measures you can't enter "= some column", so to get a value of a week we need to use a function MAX (or in some cases LASTDATE/SELECTEDVALUE).
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
Hi @zibster ,
Try this one
Measure =
VAR __week =
MAX ( 'DatesTB'[WEEK] )
RETURN
DIVIDE (
SUM ( 'SLYProj'[Sales] ),
CALCULATE (
SUM ( 'SLYProj'[Sales] ),
FILTER ( ALL ( 'DatesTB' ), 'DatesTB'[WEEK] = __week )
)
)
Tip1. If you use FILTER function to calculate an expression in different context then most of the time you need to remove all filters using a function ALL.
Tip2. Also, we need to mention a proper filter by a week of current context. In a measures you can't enter "= some column", so to get a value of a week we need to use a function MAX (or in some cases LASTDATE/SELECTEDVALUE).
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
Hi Ruslan,
Sorry to bug you again, but I was trying to replicate the calculation on the table and I am getting replication, can you advise what am I doing incorrectly.
Thanks
Z
Hi @zibster ,
You created a calculated column, but the calculation I've provided should be a measure. So create a visual and drop fields to it.
Regards,
Ruslan Zolotukhin (zoloturu)
BI Engineer at Akvelon Inc. / Kharkiv Power BI User Group Leader / DAX & Power BI Trainer
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!
It was useful? Press Thumbs Up!
You are from Ukraine? If yes then welcome to Power BI User Group - KhPUG website. Other country? Check and find proper one - Power BI User Groups
Thansk For Your help 🙂
User | Count |
---|---|
84 | |
76 | |
74 | |
49 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |