Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hello everybody
I'm having trouble creating a measure to meet the following requirements:
I have a table where there are the inspection records of places with the date and note I need to create a table visual where my measure will return me:
Solved! Go to Solution.
Hi @DavidNunes7 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table and a measure.
CALENDAR = ADDCOLUMNS(CALENDAR(DATE(2023,1,1),DATE(2023,12,31)),
"Month",FORMAT([Date],"MMMM"))
Measure 2 = var a=MAXX(FILTER(ALLSELECTED('Table'),[site name] in VALUES('Table'[site name])&&[Result]<>BLANK()),[Date])
var b=CALCULATE(SUM('Table'[Result]),FILTER('Table',EOMONTH('Table'[Date],0)=EOMONTH(MAX('CALENDAR'[Date]),0)))
var c=MINX(FILTER(ALLSELECTED('Table'),[site name] in VALUES('Table'[site name])&&[Result]<>BLANK()),[Date])
return IF(b<>BLANK(),b,IF(b=BLANK()&&MAX('CALENDAR'[Date])>a,CALCULATE(SUM('Table'[Result]),'Table'[Date]=a),IF(b=BLANK()&&MAX('CALENDAR'[Date])<C,CALCULATE(SUM('Table'[Result]),'Table'[Date]=C))))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Could you give me the measurement formula?
I can't open the file because your BI version is newer,
That will be way too many steps to list. Please retry/try on another machine with an updated version.
Perfect!!!!
Thank You 🙂
Hi @DavidNunes7 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a table and a measure.
CALENDAR = ADDCOLUMNS(CALENDAR(DATE(2023,1,1),DATE(2023,12,31)),
"Month",FORMAT([Date],"MMMM"))
Measure 2 = var a=MAXX(FILTER(ALLSELECTED('Table'),[site name] in VALUES('Table'[site name])&&[Result]<>BLANK()),[Date])
var b=CALCULATE(SUM('Table'[Result]),FILTER('Table',EOMONTH('Table'[Date],0)=EOMONTH(MAX('CALENDAR'[Date]),0)))
var c=MINX(FILTER(ALLSELECTED('Table'),[site name] in VALUES('Table'[site name])&&[Result]<>BLANK()),[Date])
return IF(b<>BLANK(),b,IF(b=BLANK()&&MAX('CALENDAR'[Date])>a,CALCULATE(SUM('Table'[Result]),'Table'[Date]=a),IF(b=BLANK()&&MAX('CALENDAR'[Date])<C,CALCULATE(SUM('Table'[Result]),'Table'[Date]=C))))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
78 | |
41 | |
40 | |
35 |