cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ragoe
Frequent Visitor

Calculated measure as a filter? (Energy meter validation)

Hi guys

 

As a power bi newbie I have only attained a basic level of DAX and have hit a brick wall.

 

I am trying to validate energy measurements and the idea is to have a filter for all my visuals that filters on wheter there are 365 measurements over 1 year per site.

 

My dataset is like: Siteno, Date, Kwh

 

I can create a measure that can be fileted in a table visual - Count(Kwh) And filter = 365 in the visual, but I can not create a calculated table that gives me the possibility to create a filter visual?

 

Help will be much appriciated. 

 

1 ACCEPTED SOLUTION

Hi @ragoe ,

 

Please try the DAX below and create the calculated column.

no.day = CALCULATE(COUNT('kwh 2018'[Dato]),ALLEXCEPT('kwh 2018','kwh 2018'[Dato]))

test_no_days.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

Not clear. Typically when you have the filter in calculate, it should filter your data in the visualization

Can you share sample data and sample output.

 



New Power BI Features
Datamarts: https://youtu.be/8tskWsJTEpg
Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin !! Proud to be a Super User!
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
!! Subscribe to my youtube Channel !!

Hi

 

I will try to clear up.

Sample:

Udklip5.PNG

 

My measure is 

Numberdays = COUNT('kwh 2018'[Dato])
 
I can set this into a table visual no problem, but I can not use this measure in a filter visual?

 

Hi @ragoe ,

 

Please try the DAX below and create the calculated column.

no.day = CALCULATE(COUNT('kwh 2018'[Dato]),ALLEXCEPT('kwh 2018','kwh 2018'[Dato]))

test_no_days.PNG

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @ragoe 

 

If you meant Slicers then measures can't be used in Slicers. What you can try to do is a Calculated Column using 'COUNT('kwh 2018'[Dato])' and use in Slicer

 

Thanks
Ankit Jain
Do Mark it as solution if the response resolved your problem. Do Kudo the response if it seems good and helpful.

 

 

ragoe
Frequent Visitor

Hi AnkitBI

 

Yes of course, I mean slicer!

 

The problem is that if I do the calculated column I only get one option in the slicer? The total count of "Kwh".?

 

Hi @ragoe 

 

Your requirement is not clear. Can you share some example of what are you trying to achieve and may be some better sample data.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors