Forum Discussion
Hour Calculation
- 3 months ago
Hi Chandrashekar for that create one more measure using below dax
Flag_Hrs_Display =IF([Hours] > 10,1,0)
If this answers your questions, kindly accept it as a solution and give kudos.
Hi Chandrashekar
I am assuming that Hours ( you are showing is a measure).
Then first Create a disconnected table (Go to Modeling -->New Table (using DAX) )
Flag_Slicer =
DATATABLE(
"Flag_Hrs", INTEGER,
{
{0},
{1}
}
)
and use this in the slicer.
Now create the second measure which will work when you select the slicer it will show (if 1 selected then only above 10 hours rows, and if 0 selected then it will show below 10 hours rows)
Flag_Filter =
VAR SelectedFlag =
SELECTEDVALUE(Flag_Slicer[Flag_Hrs], -1)
RETURN
SWITCH(
TRUE(),
SelectedFlag = 1 && [Hours] > 10, 1,
SelectedFlag = 0 && [Hours] <= 10, 1,
SelectedFlag = -1, 1, -- Nothing selected
0
)
Then select the visual and apply visual level filter.
AFter selecting the visual got to filter pane and drag Flag_Filter measure and set it to 1
If this answers your questions, kindly accept it as a solution and give kudos.
- mdaatifraza55563 months agoSuper User
Hi Chandrashekar
Also find the PBIX file to understnad how it is working.If this answers your questions, kindly accept it as a solution and give kudos.
- Chandrashekar3 months agoResolver III
Hello,
When I drag Flag_slicer in table it shows 1 but based on condition it should 0 & 1 if conditon mets.
Condtion:
If Slicer selection 1 then Flag_hours should display hours lesser then 10 hours
If slicer selection 0 then Flag_hours should display hours greater then 10 hours
Regards,
Chandrashekar B
- mdaatifraza55563 months agoSuper User
Hi Chandrashekar for that create one more measure using below dax
Flag_Hrs_Display =IF([Hours] > 10,1,0)
If this answers your questions, kindly accept it as a solution and give kudos.