The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello All,
I have Employee file Inside this I have a Measure "LeaseExpiry", when I added this measure in table visualization with "Floorplan" name. LeaseExiry Measure is showing blank value instead of 0.
Below I am sharing .pbix file link:
https://drive.google.com/file/d/1kgzK1AWX6P4RwbChHsu5KI7caqdtUsGa/view?usp=sharing
Solved! Go to Solution.
Hi @mohittimpus ,
I just updated your sample pbix file with new created page "Page 1", please check whether that is what you want. The main steps as follow:
1. Create a calculated table
Floor Plan = VALUES('employee'[FloorPlanName])
2. Create two measures or you can update the formula of measure [LeaseExpiry#1] as below:
Note: The part with red font is the one which is different with yours
00_Measure = var temp = SELECTEDVALUE('Week Table'[Week End date])
var yearmonth = INT(YEAR(temp)&""&IF(MONTH(temp)<10,"0"&MONTH(temp),MONTH(temp)))
var order1 = CALCULATE(VALUES('Lease Exp Table'[Year Month Rank]),FILTER('Lease Exp Table','Lease Exp Table'[Year_Month]=yearmonth))
var _a=
CALCULATE(
calculate(
count('employee'[LeaseId]) ,
('employee'[LeaseStatus] = "Current" ||
'employee'[LeaseStatus] = "Future" ||
'employee'[LeaseStatus] = "Notice"),FILTER(ALL('employee'[Year Month Rank],'employee'[FloorPlanName]),'employee'[FloorPlanName]=MAX('Floor Plan'[FloorPlanName])&&'employee'[Year Month Rank]-1<=order1+11&&employee[Year Month Rank]-1>=order1)),CROSSFILTER('Week Table'[Date],'employee'[CreatedOn],None))
return _a+0
|
01_Measure = SUMX(VALUES('Floor Plan'[FloorPlanName]),[00_Measure])
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Hi @mohittimpus ,
I just updated your sample pbix file with new created page "Page 1", please check whether that is what you want. The main steps as follow:
1. Create a calculated table
Floor Plan = VALUES('employee'[FloorPlanName])
2. Create two measures or you can update the formula of measure [LeaseExpiry#1] as below:
Note: The part with red font is the one which is different with yours
00_Measure = var temp = SELECTEDVALUE('Week Table'[Week End date])
var yearmonth = INT(YEAR(temp)&""&IF(MONTH(temp)<10,"0"&MONTH(temp),MONTH(temp)))
var order1 = CALCULATE(VALUES('Lease Exp Table'[Year Month Rank]),FILTER('Lease Exp Table','Lease Exp Table'[Year_Month]=yearmonth))
var _a=
CALCULATE(
calculate(
count('employee'[LeaseId]) ,
('employee'[LeaseStatus] = "Current" ||
'employee'[LeaseStatus] = "Future" ||
'employee'[LeaseStatus] = "Notice"),FILTER(ALL('employee'[Year Month Rank],'employee'[FloorPlanName]),'employee'[FloorPlanName]=MAX('Floor Plan'[FloorPlanName])&&'employee'[Year Month Rank]-1<=order1+11&&employee[Year Month Rank]-1>=order1)),CROSSFILTER('Week Table'[Date],'employee'[CreatedOn],None))
return _a+0
|
01_Measure = SUMX(VALUES('Floor Plan'[FloorPlanName]),[00_Measure])
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Hello @v-yiruan-msft ,
Thanks I got Zero(0) in the place of blank but I am showing only next 12 month data from selected week filter at
the top. but now it is giving me all year and month data which available in Database. so It should not happen like
this. It should show only 12 month data as i am showing and I want Zero(0) in place of blank.
Below i am sharing my original .pbix file below:
https://drive.google.com/file/d/1kgzK1AWX6P4RwbChHsu5KI7caqdtUsGa/view?usp=sharing
I second both of the options provided by @edhans & @Pragati11 as solutions for your current issue.
Wrap your measure in COALESCE @mohittimpus , so COALESCE(YourMeasureCode, 0)
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingJoin the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
94 | |
88 | |
71 | |
65 |
User | Count |
---|---|
241 | |
124 | |
120 | |
81 | |
79 |