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 community,
I have a quite complicated scnario. Below you will find the example data, you can copy past to the power bi or you can download the file from: https://gofile.io/d/wo5E1V
I have a measure, which is working for the selection of slider1 or slider2. The measure is:
I want to update the measure saying that: if slider1 or slider2 is not selected, show the value for Slider1="#", Slider2="#", MainFilter="V"
For example; slider1 and slider2 is not selected, Date is 07.2020 then the value should be 66.
If slider1 or slider2 is selected, then it should give the values, based on the measure "Plan Working3".
"Calendar" Table
MonthYearMonthYearDateOrder
11.2019 | Friday, November 1, 2019 | 1 |
12.2019 | Sunday, December 1, 2019 | 2 |
01.2020 | Wednesday, January 1, 2020 | 3 |
02.2020 | Saturday, February 1, 2020 | 4 |
03.2020 | Sunday, March 1, 2020 | 5 |
07.2020 | Wednesday, July 1, 2020 | 6 |
08.2020 | Saturday, August 1, 2020 | 7 |
Table "Table":
Slider1Slider2DateValueDateFormatedMainFilter
# | A | 07.2020 | 12 | Tuesday, January 7, 2020 | # |
# | B | 07.2020 | 14 | Tuesday, January 7, 2020 | # |
C1 | A | 07.2020 | 21 | Tuesday, January 7, 2020 | # |
C2 | A | 07.2020 | 23 | Tuesday, January 7, 2020 | # |
D1 | B | 07.2020 | 32 | Tuesday, January 7, 2020 | # |
D2 | B | 07.2020 | 34 | Tuesday, January 7, 2020 | # |
# | A | 08.2020 | 42 | Wednesday, January 8, 2020 | # |
# | B | 08.2020 | 44 | Wednesday, January 8, 2020 | # |
C1 | A | 08.2020 | 55 | Wednesday, January 8, 2020 | # |
C2 | A | 08.2020 | 35 | Wednesday, January 8, 2020 | # |
D1 | B | 08.2020 | 46 | Wednesday, January 8, 2020 | # |
D2 | B | 08.2020 | 65 | Wednesday, January 8, 2020 | # |
# | A | 11.2019 | 77 | Friday, January 11, 2019 | # |
# | B | 11.2019 | 76 | Friday, January 11, 2019 | # |
C1 | A | 11.2019 | 54 | Friday, January 11, 2019 | # |
C2 | A | 11.2019 | 66 | Friday, January 11, 2019 | # |
D1 | B | 11.2019 | 56 | Friday, January 11, 2019 | # |
D2 | B | 11.2019 | 67 | Friday, January 11, 2019 | # |
# | # | 07.2020 | 66 | Tuesday, January 7, 2020 | V |
# | # | 08.2020 | 77 | Tuesday, January 7, 2020 | V |
# | # | 11.2019 | 88 | Tuesday, January 7, 2020 | V |
All the best,
Solved! Go to Solution.
Hi @IF ,
Please try this measure:
Plan Working =
VAR _slider1 = SELECTEDVALUE('Table'[Slider1])
RETURN
IF(NOT(HASONEVALUE('Table'[Slider1])) && NOT(HASONEVALUE('Table'[Slider2])),
CALCULATE(Sum('Table'[Value]), FILTER('Table', 'Table'[Slider1] = "#" && 'Table'[Slider2] = "#")),
[Plan Working3]
)
_______________
If I helped, please accept the solution and give kudos! 😀
@IF , Not very clear , something like this
switch( true(),
not(isfiltered('Table'[Slider1])) && not(isfiltered('Table'[Slider2])) , "#",
CALCULATE(Sum('Table'[Value]), FILTER('Table', 'Table'[Slider1] = "#"))
)
Hi,
To make it clear, it will be easy to run the current measure without column "MainFilter". As you can see from the current measure you can select date; for example; 07.2020. If I select A, result is 12. Similarly the result is 14 for B, 21 for C1, 23 for C2, 32 for D1 and 34 for D2. Until it works.
What I want if either slider1 or slider2 is not selected, I want to see the value 66 as I explained at the previous post.
I hope it is clear.
Thanks in advance!
Hi,
Here is another link. https://gofile.io/d/cuPNYz
I tried in two ways. The first file screen shots. If Slider1 or Slider2 is not selected, I want to see 66 value in a measure (for month 07.2020).
I tried with another way at night. The link has second file.
I saw a similar example with another project. It was not in a similar way, but mine doesn't work.
If there is a better way of uploading the files, I can do it in that way. I think it is quite easy if you open the files.
All the best,
Hi @IF ,
Please try this measure:
Plan Working =
VAR _slider1 = SELECTEDVALUE('Table'[Slider1])
RETURN
IF(NOT(HASONEVALUE('Table'[Slider1])) && NOT(HASONEVALUE('Table'[Slider2])),
CALCULATE(Sum('Table'[Value]), FILTER('Table', 'Table'[Slider1] = "#" && 'Table'[Slider2] = "#")),
[Plan Working3]
)
_______________
If I helped, please accept the solution and give kudos! 😀
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 |
---|---|
110 | |
94 | |
80 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |