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.
I have situation here where I have sales amount only for current month. We have a measure Var_Sales which calculates this Total_Sales amount and replaces for the whole year
Var_Sales = calculate(sum([Total_Sales]), ( ALL('Time'[Year],'Time'[Month]))
Month | Total_Sales | Var_Sales |
1 | 0 | 100000 |
2 | 0 | 100000 |
3 | 0 | 100000 |
4 | 0 | 100000 |
5 | 0 | 100000 |
6 | 0 | 100000 |
7 | 0 | 100000 |
8 | 0 | 100000 |
9 | 0 | 100000 |
10 | 0 | 100000 |
11 | 100000 | 100000 |
12 | 0 | 100000 |
I have a requirement where i need this values to only populate for 1st three months(quarter) in the measure itself.
I tried below dax but getting the values to 0
Var_Sales = calculate(sum([Total_Sales]), ( ALL('Time'[Year],'Time'[Month]))
3months= calculate(VAR_SALES, FILTER('TIME,Time'[Month])<4)
What i need is as below
Month | Toota_Sales | Var_Sales | 3months |
1 | 0 | 100000 | 100000 |
2 | 0 | 100000 | 100000 |
3 | 0 | 100000 | 100000 |
4 | 0 | 100000 | 0 |
5 | 0 | 100000 | 0 |
6 | 0 | 100000 | 0 |
7 | 0 | 100000 | 0 |
8 | 0 | 100000 | 0 |
9 | 0 | 100000 | 0 |
10 | 0 | 100000 | 0 |
11 | 100000 | 100000 | 0 |
12 | 0 | 100000 | 0 |
Hi @Bitech
Try this:
Column =
Var _Sales = calculate(sum(Table[Total_Sales]), ALL(Table))
Var _MaxM = Max(Table[Month])
return
If(_MaxM<=3,_Sales,0)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
This didnt work , here
Total_Sales is a measure and it does not have month in it |
@Bitech , Assuming var sales is a measure try a measure
Measure =
var _1 = minx(allselected(Table) , Table[Month])
return
calculate([Var_Sales], filter(Table, Table[Month] <= _1 +3))
@amitchandak Here Var_Sales is a measure and Month is in Time measure. not able to use allslected function here
User | Count |
---|---|
16 | |
14 | |
13 | |
12 | |
11 |
User | Count |
---|---|
19 | |
16 | |
15 | |
11 | |
9 |