Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
misiek5510
Helper III
Helper III

Unpivoted Columns - Filtering with use of Measure or CC

Hi,

 

I have unpivoted multiple columns which where all values, however they are of mixed type. (Whole number, % , Decimals) 

Is there a way to get an value for a given attribute with use of measure or caluclated column? 

Attribute Value
A5
B7
D0.2
E5.2

 

D = 20%

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Try:

D Value = 
CALCULATE(SUM(Table[Value]), Table [Attribute] = "D")

and then format the measure as a %





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
misiek5510
Helper III
Helper III

It worked great thanks 🙂 I've also used the below for a card visual. 🙂 

 

D Value = 
CALCULATE(SUM(Table[Value]), Table [Attribute] = "D"), LASTDATE(Table[Date].date))

 

 

 

 

 

PaulDBrown
Community Champion
Community Champion

Try:

D Value = 
CALCULATE(SUM(Table[Value]), Table [Attribute] = "D")

and then format the measure as a %





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you so much 🙂 Could I possibly average the result it brings via MTD funciton somehow? (I have a column "DATE and if goes up in 7 day (week) intervals. 


It would help if you posted a sample of the data and the expected outcome





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






For Example:

DateAt.Val.
1/1/2022A5
1/1/2022B0.2
7/1/2022A12
7/1/2022B0.4

 

B = 30% (Average based on two weeks in that month). 

Do you have a date table?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






See if this works:

Aver. B Value = 
CALCULATE(AVERAGE('Table'[Val.]),'Table'[At.] = "B")
Ave. B Value By Month =
VAR MNTH =
    MONTH ( MAX ( 'Table'[Date] ) )
VAR _Calc =
    CALCULATE (
        [Aver. B Value],
        FILTER ( ALL ( 'Table' ), MONTH ( 'Table'[Date] ) = MNTH )
    )
RETURN
    IF ( AND ( MAX ( 'Table'[At.] ) = "B", ISINSCOPE ( 'Table'[At.] ) ), _Calc )

Result.jpg

I've attached the sample PBIX file 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.